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

1 Commits

Author SHA1 Message Date
e195e93f1a Add touch support to pathfinding canvas
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.
2026-02-04 08:35:41 +01:00