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) {
825825 this . height ,
826826 e
827827 ) ;
828- this . _setProperty ( 'movedX' , e . movementX ) ;
829- this . _setProperty ( 'movedY' , e . movementY ) ;
828+
830829 this . _setProperty ( 'mouseX' , mousePos . x ) ;
831830 this . _setProperty ( 'mouseY' , mousePos . y ) ;
832831 this . _setProperty ( 'winMouseX' , mousePos . winX ) ;
833832 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 ) ;
834838 }
839+
835840 if ( ! this . _hasMouseInteracted ) {
836- // For first draw, make previous and next equal
837841 this . _updateMouseCoords ( ) ;
838842 this . _setProperty ( '_hasMouseInteracted' , true ) ;
839843 }
You can’t perform that action at this time.
0 commit comments