@@ -912,25 +912,25 @@ function pointer(p5, fn){
912
912
913
913
fn . _updatePointerCoords = function ( e ) {
914
914
if ( this . _curElement !== null ) {
915
- const canvas = this . _curElement . elt ;
916
- const sx = canvas . scrollWidth / this . width || 1 ;
917
- const sy = canvas . scrollHeight / this . height || 1 ;
915
+ const canvas = this . _curElement . elt ;
916
+ const sx = canvas . scrollWidth / this . width || 1 ;
917
+ const sy = canvas . scrollHeight / this . height || 1 ;
918
918
919
- if ( e . pointerType == 'touch' ) {
919
+ if ( e . pointerType == 'touch' ) {
920
920
const touches = [ ] ;
921
921
for ( const touch of this . _activePointers . values ( ) ) {
922
- touches . push ( getTouchInfo ( canvas , sx , sy , touch ) ) ;
922
+ touches . push ( getTouchInfo ( canvas , sx , sy , touch ) ) ;
923
923
}
924
924
this . touches = touches ;
925
- } else {
926
- const mousePos = getMouseInfo ( canvas , sx , sy , e ) ;
927
- this . movedX = e . movementX || 0 ;
928
- this . movedY = e . movementY || 0 ;
929
- this . mouseX = mousePos . x ;
930
- this . mouseY = mousePos . y ;
931
- this . winMouseX = mousePos . winX ;
932
- this . winMouseY = mousePos . winY ;
933
- }
925
+ }
926
+
927
+ const mousePos = getMouseInfo ( canvas , sx , sy , e ) ;
928
+ this . movedX = e . movementX || 0 ;
929
+ this . movedY = e . movementY || 0 ;
930
+ this . mouseX = mousePos . x ;
931
+ this . mouseY = mousePos . y ;
932
+ this . winMouseX = mousePos . winX ;
933
+ this . winMouseY = mousePos . winY ;
934
934
935
935
if ( ! this . _hasMouseInteracted ) {
936
936
this . _updateMouseCoords ( ) ;
0 commit comments