File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -825,15 +825,19 @@ p5.prototype._updateNextMouseCoords = function(e) {
825
825
this . height ,
826
826
e
827
827
) ;
828
- this . _setProperty ( 'movedX' , e . movementX ) ;
829
- this . _setProperty ( 'movedY' , e . movementY ) ;
828
+
830
829
this . _setProperty ( 'mouseX' , mousePos . x ) ;
831
830
this . _setProperty ( 'mouseY' , mousePos . y ) ;
832
831
this . _setProperty ( 'winMouseX' , mousePos . winX ) ;
833
832
this . _setProperty ( 'winMouseY' , mousePos . winY ) ;
833
+
834
+ const deltaX = this . mouseX - this . pmouseX ;
835
+ const deltaY = this . mouseY - this . pmouseY ;
836
+ this . _setProperty ( 'movedX' , deltaX ) ;
837
+ this . _setProperty ( 'movedY' , deltaY ) ;
834
838
}
839
+
835
840
if ( ! this . _hasMouseInteracted ) {
836
- // For first draw, make previous and next equal
837
841
this . _updateMouseCoords ( ) ;
838
842
this . _setProperty ( '_hasMouseInteracted' , true ) ;
839
843
}
You can’t perform that action at this time.
0 commit comments