Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
diyaayay committed Nov 23, 2024
1 parent 37e431a commit dcaa55a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/core/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ class p5 {
keyup: null,
keypress: null,
wheel: null,
touchstart: null,
touchmove: null,
touchend: null,
resize: null,
blur: null
};
Expand Down
8 changes: 8 additions & 0 deletions src/events/pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,14 @@ function pointer(p5, fn){
let executeDefault;
this._updatePointerCoords(e);

if(e.pointerType === 'touch') {
this._activeTouches.set(e.pointerId, e);
const touches = Array.from(this._activeTouches.values()).map((touch)=>
getTouchInfo(this._curElement.elt, this.width, this.height, touch)
);
this.touches = touches;
}

if (!this.mouseIsPressed && typeof context.mouseMoved === 'function') {
executeDefault = context.mouseMoved(e);
if (executeDefault === false) {
Expand Down

0 comments on commit dcaa55a

Please sign in to comment.