Skip to content

Fix WASM Alt+LMB rectangle multi-select (#220) - #250

Merged
trailcode merged 3 commits into
mainfrom
Trailcode/wasm-box-select-fix
Aug 7, 2026
Merged

Fix WASM Alt+LMB rectangle multi-select (#220)#250
trailcode merged 3 commits into
mainfrom
Trailcode/wasm-box-select-fix

Conversation

@trailcode

@trailcode trailcode commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix WASM Alt+LMB rubber-band multi-select: poll modifiers/cursor via a non-owning GLFWwindow* (Occt_glfw_win is not created on Emscripten, so live Alt was always missing and OCCT rebound the gesture to orbit).
  • After OCCT SelectRectangle, also select displayed document solids whose projected AABB intersects the band (complex / STEP parts stock picking often skipped). On WASM, map OCCT window pixels into GLFW cursor space.
  • Shape List: selection tint follows AIS only; current group uses a weaker tint so it is not mistaken for selection after Alt-drag.
  • Docs: usage.md, usage-occt-view.md, gui.md, CHANGELOG; plan wasm-alt-drag-multiselect.md.

Fixes #220

Test plan

  • Desktop: Alt+LMB box-selects multiple shapes (including complex solids under Shape List groups)
  • WASM: Alt+LMB multi-select works; click canvas first if the browser steals Alt
  • Ctrl+click multi-select still works
  • Shape List current-group highlight is distinct from AIS selection
  • CI / EzyCad_tests (includes Grouped_solids_stay_displayed_and_selectable)

Related


Note

Medium Risk
Touches core 3D input, selection override, and shared modifier polling on desktop and WASM; behavior change is localized to Alt-drag and post-rectangle selection.

Overview
Fixes #220 by making Alt + left-drag rectangle multi-select work on the WASM build and improving rubber-band picking for complex parts.

WASM input: Occt_view stores a non-owning GLFWwindow* for live modifier and cursor polling (Emscripten never creates Occt_glfw_win, so Alt was always missing on mouse-move and OCCT treated the gesture as orbit). Zoom and mouse paths use the same GLFW cursor space.

Rubber-band picking: After OCCT SelectRectangle, displayed document solids whose projected AABB overlaps the band are added to the selection—addressing misses on complex / STEP BREPs and grouped shapes. On WASM, projected pixels are scaled from OCCT window size to GLFW/canvas size.

Shape List: Row highlight for selection follows the 3D viewer only; the current group gets a lighter tint so it is not confused with multi-select after Alt-drag.

Docs, CHANGELOG, agent plan/drafts, and a grouped-solid selection test are updated.

Reviewed by Cursor Bugbot for commit d7e2561. Bugbot is set up for automated code reviews on this repo. Configure here.

Trailcode added 2 commits August 6, 2026 18:25
@trailcode
trailcode merged commit ac12159 into main Aug 7, 2026
4 checks passed
@trailcode
trailcode deleted the Trailcode/wasm-box-select-fix branch August 7, 2026 00:40
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.

WASM: Alt + LMB drag does not multi-select shapes

1 participant