feat(snap): Shift hard axis lock during point picks (#312)

Holding Shift while a command asks for a point captures the nearest
polar increment (or ortho axis, UCS-aware) from the rubber-band base
toward the cursor and pins the pick to that ray. Every candidate —
osnap hits included — projects onto the locked direction, so a snap far
off-axis contributes only its along-axis component; the click commits
exactly what the preview shows. The direction stays fixed while Shift
is held and drops the moment it releases. Grip drags get the same lock
from the grip origin.

Guards: engages only when the active command wants a point — never
during entity picks (Shift there is the TRIM/EXTEND swap), tangent
picks, selection gathering or window-corner picks.

Closes #312

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Fable 5 committed 2026-07-22 16:34:47 +03:00
1 parent ba73c48aec
commit 51f07f1208
4 files changed
+119 -4

No files matched your search

+6
View File
@@ -559,6 +559,11 @@ pub(super) struct OpenCADStudio {
/// Cursor-anchored one-shot snap override menu (Shift+RMB): the canvas
/// point it opened at, or `None` when closed (#337).
snap_override_popup: Option<iced::Point>,
/// Hard axis lock (#312): the WCS direction captured when Shift went down
/// during a rubber-band point pick. While `Some`, every candidate point —
/// osnap hits included — projects onto this ray from `last_point` (or the
/// grip origin). Cleared when Shift releases.
axis_lock_dir: Option<glam::DVec3>,
/// Inline rename state: (original_name, current_edit_value).
layout_rename_state: Option<(String, String)>,
/// Timestamp of the previous viewport left-click release (for double-click detection).
@@ -2358,6 +2363,7 @@ impl OpenCADStudio {
text_inline: None,
layout_context_menu: None,
snap_override_popup: None,
axis_lock_dir: None,
layout_rename_state: None,
last_vp_click_time: None,
last_vp_click_pos: None,