cad-editor/src
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
..
app fix(ctx-menu): anchor right-click menu under cursor, share overlay infra 2026-05-29 15:58:23 +03:00
command fix(dyn-input): correct Y coordinate, label by prompt type — #27 2026-05-27 13:41:54 +03:00
entities feat(grip): popup menus for polylines, spline, mline, hatch, leaders, text 2026-05-29 15:14:43 +03:00
io chore: rename H7CAD to Open CAD Studio 2026-05-23 17:16:15 +03:00
modules refactor(ui): remove the viewport navigation bar 2026-05-27 17:49:23 +03:00
scene feat(grip): popup menus for polylines, spline, mline, hatch, leaders, text 2026-05-29 15:14:43 +03:00
shaders fix(viewport): blit UV crop for off-canvas viewports 2026-05-28 12:15:00 +03:00
snap fix(snap): correct snap symbols + drop bogus midpoints on circles (#34) 2026-05-29 01:39:02 +03:00
ui refactor(grip): square-only marker set + oriented stretch handles 2026-05-29 02:07:34 +03:00
lib.rs feat: in-app update notice — checks GitHub releases on startup 2026-05-16 19:55:57 +03:00
linetypes.rs chore: rename H7CAD to Open CAD Studio 2026-05-23 17:16:15 +03:00
main.rs chore(release): drop flatpak, add macOS .dmg, hide Windows console 2026-05-20 21:13:02 +03:00
patterns.rs chore: rename H7CAD to Open CAD Studio 2026-05-23 17:16:15 +03:00
update_check.rs feat(update-check): suppress popup for releases under 30 min old 2026-05-29 15:29:00 +03:00