Skip to content

Fix browser mouse coordinates and drag release outside canvas - #205

Merged
treeform merged 1 commit into
masterfrom
fix/browser-mouse-drag-state
Nov 4, 2026
Merged

treeform merged 1 commit into
masterfrom
fix/browser-mouse-drag-state

Conversation

@treeform

@treeform treeform commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Refresh canvas-relative mouse coordinates before button callbacks, preventing activation clicks from using an old pointer position.
  • Capture document-level move/up events for drags that leave the canvas; ignore unrelated unheld document events.
  • Reset pointer history on entry and focus loss.
  • Add a WASM fixture and browser regression script.

Validation

  • Built examples/mouse_drag_regression.nim with Emscripten.
  • Ran tests/browser_mouse_drag.js in Chrome: current press position, outside drag movement, outside release, and cleared button state all passed.
  • Verified offset-canvas coordinates separately in Chrome.
  • Built and launched GotA WASM against this backend.
  • Independent review and git diff --check passed.

The similar #198 fixes native macOS button positions; this PR addresses the browser backend.

@treeform
treeform merged commit 744a0e8 into master Nov 4, 2026
3 checks passed
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.

1 participant