forked from 1b-agent/opencadstudio-upstream
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:
commit
45bc31f730
8 files changed
+287
-13
No files matched your search
@@ -835,6 +835,28 @@ impl OpenCADStudio {
|
||||
return self.focus_cmd_input();
|
||||
}
|
||||
}
|
||||
if let Some(override_kind) = crate::snap::parse_snap_override(&raw) {
|
||||
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.command_line.input.clear();
|
||||
self.apply_snap_override(override_kind);
|
||||
return self.focus_cmd_input();
|
||||
}
|
||||
}
|
||||
let text = if free_text {
|
||||
raw
|
||||
} else {
|
||||
@@ -933,6 +955,7 @@ impl OpenCADStudio {
|
||||
self.dyn_coord_absolute = false;
|
||||
self.sync_dyn_fields();
|
||||
self.reset_tracking_after_point();
|
||||
self.snapper.clear_override();
|
||||
self.push_ucs_to_cmd(i);
|
||||
let result = self.tabs[i].active_cmd.as_mut().map(|c| c.on_point(wcs_pt));
|
||||
if let Some(r) = result {
|
||||
@@ -1048,6 +1071,7 @@ impl OpenCADStudio {
|
||||
self.dyn_coord_absolute = false;
|
||||
self.sync_dyn_fields();
|
||||
self.reset_tracking_after_point();
|
||||
self.snapper.clear_override();
|
||||
if let Some((_, dir)) = distance_ray {
|
||||
self.snapper.remember_distance_reference(dir);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user