Posted inJavaScript
How to detect mouse coordinates on canvas in JavaScript
Track canvas pointer coordinates with pointermove and getBoundingClientRect(), verify CSS-pixel positions, and use setPointerCapture() to support dragging beyond canvas bounds.



