Skip to content

Fix orbitControl() breaking after touch swipe outside canvas.#8863

Merged
ksen0 merged 4 commits into
processing:dev-2.0from
perminder-17:touch-orbitControl
Jun 2, 2026
Merged

Fix orbitControl() breaking after touch swipe outside canvas.#8863
ksen0 merged 4 commits into
processing:dev-2.0from
perminder-17:touch-orbitControl

Conversation

@perminder-17

Copy link
Copy Markdown
Collaborator

Resolves #8049

Changes:
p5 listened for pointerup but not pointercancel. On Android, swiping a touch outside the canvas fires pointercancel instead of pointerup, so the pointer was never removed from _activePointers. These stale pointers piled up, touches.length never returned to 1, and orbitControl() (which rotates only when movedTouches.length === 1) stopped working. Thanks @inaridarkfox4231 for catching this.

Fix: handle pointercancel to remove the cancelled pointer, refresh touches, and reset mouseIsPressed when no pointers remain.

https://editor.p5js.org/aman12345/sketches/Z2wBEt3ka

Screenshots of the change:

PR Checklist

@p5-bot

p5-bot Bot commented Jun 2, 2026

Copy link
Copy Markdown

@ksen0 ksen0 merged commit beff79e into processing:dev-2.0 Jun 2, 2026
5 checks passed
vamshi567bh pushed a commit to vamshi567bh/p5.js that referenced this pull request Jun 20, 2026
Fix orbitControl() breaking after touch swipe outside canvas.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[p5.js 2.0 Bug Report]: Unnatural behavior when executing orbitControl() on Android phones

2 participants