Left click now exclusively drags corner/edge handles.
Middle click pans the view. preventDefault on mousedown
suppresses the browser's autoscroll activation on middle click.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Instead of applying raw 2D delta, project cursor movement onto the
outward normal of each edge so the edge can only be pushed/pulled
perpendicular to itself. Prevents shearing when dragging a side handle.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Canvas width now read via getBoundingClientRect after setting style.width=100%,
avoiding the parentElement.clientWidth padding issue that made css_w exceed
the actual rendered width and broke hit-testing
- All handle drags (corners + midpoints) now use relative delta via drag_prev_img
instead of absolute cursor position, preventing handle teleport on grab
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drag indices 4-7 correspond to top/right/bottom/left edge midpoints.
Dragging a midpoint applies the delta to both adjacent corners, making
it easier to align bins with rounded corners where corner handles may
be obscured.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>