Merge pull request #1707 from yztink/feat/snap-overrides

feat(snap): add transparent object snap overrides in active commands typed on command-line

# Conflicts:
#	src/app/update/command.rs
This commit is contained in:
Hakan Seven committed 2026-10-11 23:39:07 +03:00
commit 45bc31f730
8 files changed
+287 -13

No files matched your search

+22
View File
@@ -602,6 +602,7 @@ impl OpenCADStudio {
if !self.record_accepted_snap(i, None, None, *point) {
return (Task::none(), true);
}
self.snapper.clear_override();
}
if default_start {
let StepInput::Point(point) = &input else {
@@ -1140,6 +1141,27 @@ impl OpenCADStudio {
return Task::none();
}
}
if let Some(override_kind) = crate::snap::parse_snap_override(token) {
let is_point_step = !self.tabs[i]
.active_cmd
.as_ref()
.map(|c| c.input_kind().wants_text())
.unwrap_or(true)
|| self.tabs[i]
.active_cmd
.as_ref()
.map(|c| c.point_step_accepts_keywords())
.unwrap_or(false);
let not_entity_pick = !self.tabs[i]
.active_cmd
.as_ref()
.map(|c| c.needs_entity_pick())
.unwrap_or(false);
if is_point_step && not_entity_pick {
self.apply_snap_override(override_kind);
return Task::none();
}
}
if let Some((coord, kind)) = crate::app::helpers::parse_coord(token) {
// Match the GUI command line: typed coordinates are in the active
// UCS (relative offsets are rotated by the UCS axes), so a multi-