Add touch support to pathfinding canvas #7

Merged
lobo merged 1 commits from bugfix/touchbugfix into main 2026-02-04 08:36:09 +01:00
Owner

Register touch event handlers (touchstart, touchmove, touchend) that call existing mouse handlers and prevent default scrolling (passive: false) so the canvas can be interacted with on touch devices. Update getGridPosition to accept TouchEvent or MouseEvent, read touch coordinates, and apply canvas-to-CSS scaling (canvas.width/rect.width and canvas.height/rect.height) to correctly map client coordinates to grid cells. This enables accurate touch interaction and handles high-DPI / CSS-scaled canvases.

Register touch event handlers (touchstart, touchmove, touchend) that call existing mouse handlers and prevent default scrolling (passive: false) so the canvas can be interacted with on touch devices. Update getGridPosition to accept TouchEvent or MouseEvent, read touch coordinates, and apply canvas-to-CSS scaling (canvas.width/rect.width and canvas.height/rect.height) to correctly map client coordinates to grid cells. This enables accurate touch interaction and handles high-DPI / CSS-scaled canvases.
lobo added 1 commit 2026-02-04 08:36:06 +01:00
Register touch event handlers (touchstart, touchmove, touchend) that call existing mouse handlers and prevent default scrolling (passive: false) so the canvas can be interacted with on touch devices. Update getGridPosition to accept TouchEvent or MouseEvent, read touch coordinates, and apply canvas-to-CSS scaling (canvas.width/rect.width and canvas.height/rect.height) to correctly map client coordinates to grid cells. This enables accurate touch interaction and handles high-DPI / CSS-scaled canvases.
lobo merged commit 24bf329628 into main 2026-02-04 08:36:09 +01:00
lobo deleted branch bugfix/touchbugfix 2026-02-04 08:36:10 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Lobo_Corp/playground-frontend#7