cad-editor/src/app
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hakan Seven cf925be861 fix(ctx-menu): anchor right-click menu under cursor, share overlay infra
The right-click context menu was being placed via window-relative
coordinates while the cursor position it anchored to was canvas-relative,
so the menu drifted away from the cursor by the size of the surrounding
ribbon / sidebar / status bar.

Move the menu inside `viewport_stack` so its anchor resolves in the same
coordinate space the cursor was captured in. Introduce
`position_canvas_overlay(anchor, panel)` — wraps `panel` in a column+row
of fixed-width spacers and `iced::widget::opaque(panel)` so events on the
menu itself don't fall through to the viewport mouse area underneath.
The multi-functional grip popup is rewritten to use the same helper.

Outside-click dismiss now mirrors the grip popup: `ViewportLeftPress`
checks `selection.context_menu.take()` at the top and returns early
when it was set, so a press that reaches the viewport mouse area
(i.e. outside the opaque panel) closes the menu without running the
rest of the left-click handler. The redundant `context_menu = None`
later in the handler and the now-unused `Message::ViewportContextMenuClose`
are removed.

Two related issues fixed in the same pass:

* The right-drag threshold for orbit was 3 px squared, small enough that
  normal hand jitter between a right-button press and release was
  promoting a click to a drag and suppressing the menu on release.
  Bumped to 8 px squared.
* `Message::ViewportExit` was clearing `context_menu`. With the menu now
  living above the viewport mouse area, the opaque panel capturing the
  cursor fires the underlying area's exit handler — which closed the
  menu the instant it opened. Stop clearing the menu there; outside-click
  dismiss is enough.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 15:58:23 +03:00
..
cmd_result.rs feat(commandline): always-on keyboard capture + space submits like enter 2026-05-26 18:59:51 +03:00
commands.rs fix(layer): propagate LAY* command changes to panel + dropdown (#39) 2026-05-29 01:30:02 +03:00
document.rs fix(dyn-input): support cartesian coords via "," (#35) 2026-05-29 00:46:18 +03:00
helpers.rs feat(input): relative coordinate entry (@/#) and DYN default — #26 2026-05-27 11:40:28 +03:00
history.rs fix(viewport): adapt entity colours to visible bg 2026-05-28 18:28:18 +03:00
layers.rs fix(layer): propagate LAY* command changes to panel + dropdown (#39) 2026-05-29 01:30:02 +03:00
mod.rs fix(ctx-menu): anchor right-click menu under cursor, share overlay infra 2026-05-29 15:58:23 +03:00
properties.rs chore: rename H7CAD to Open CAD Studio 2026-05-23 17:16:15 +03:00
update.rs fix(ctx-menu): anchor right-click menu under cursor, share overlay infra 2026-05-29 15:58:23 +03:00
view.rs fix(ctx-menu): anchor right-click menu under cursor, share overlay infra 2026-05-29 15:58:23 +03:00