fix(otrack): reset tracking points after each committed point
OTRACK acquired points only ever cleared when a command ended, so a multi-point command (LINE, etc.) accumulated tracking points across every input, swamping the user with alignment options. Clear the acquired points and live alignment vector each time a point is committed to the active command, at all five point-accept paths. (issue #85) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
9de2760dee
commit
dc26c8128c
1 changed files with 14 additions and 0 deletions
|
|
@ -74,6 +74,15 @@ impl OpenCADStudio {
|
||||||
task
|
task
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Drop the OTRACK acquired points and the live alignment vector once a
|
||||||
|
/// point has been committed to the active command. Temporary tracking
|
||||||
|
/// points are reset on every input so they don't pile up across a
|
||||||
|
/// multi-point command and overwhelm the next pick (issue #85).
|
||||||
|
fn reset_tracking_after_point(&mut self) {
|
||||||
|
self.snapper.clear_tracking();
|
||||||
|
self.otrack_active = None;
|
||||||
|
}
|
||||||
|
|
||||||
/// Snapshot the persisted UI preferences from live state.
|
/// Snapshot the persisted UI preferences from live state.
|
||||||
pub(super) fn current_settings(&self) -> super::settings::UserSettings {
|
pub(super) fn current_settings(&self) -> super::settings::UserSettings {
|
||||||
super::settings::UserSettings {
|
super::settings::UserSettings {
|
||||||
|
|
@ -1263,6 +1272,7 @@ impl OpenCADStudio {
|
||||||
self.last_point = Some(pt);
|
self.last_point = Some(pt);
|
||||||
self.dyn_user_reshaped = false;
|
self.dyn_user_reshaped = false;
|
||||||
self.sync_dyn_fields();
|
self.sync_dyn_fields();
|
||||||
|
self.reset_tracking_after_point();
|
||||||
let result = self.tabs[i].active_cmd.as_mut().map(|c| c.on_point(pt));
|
let result = self.tabs[i].active_cmd.as_mut().map(|c| c.on_point(pt));
|
||||||
if let Some(r) = result {
|
if let Some(r) = result {
|
||||||
let task = self.apply_cmd_result(r);
|
let task = self.apply_cmd_result(r);
|
||||||
|
|
@ -1309,6 +1319,7 @@ impl OpenCADStudio {
|
||||||
self.last_point = Some(wcs_pt);
|
self.last_point = Some(wcs_pt);
|
||||||
self.dyn_user_reshaped = false;
|
self.dyn_user_reshaped = false;
|
||||||
self.sync_dyn_fields();
|
self.sync_dyn_fields();
|
||||||
|
self.reset_tracking_after_point();
|
||||||
let result = self.tabs[i].active_cmd.as_mut().map(|c| c.on_point(wcs_pt));
|
let result = self.tabs[i].active_cmd.as_mut().map(|c| c.on_point(wcs_pt));
|
||||||
if let Some(r) = result {
|
if let Some(r) = result {
|
||||||
let task = self.apply_cmd_result(r);
|
let task = self.apply_cmd_result(r);
|
||||||
|
|
@ -3259,6 +3270,7 @@ impl OpenCADStudio {
|
||||||
self.last_point = Some(world_pt);
|
self.last_point = Some(world_pt);
|
||||||
self.dyn_user_reshaped = false;
|
self.dyn_user_reshaped = false;
|
||||||
self.sync_dyn_fields();
|
self.sync_dyn_fields();
|
||||||
|
self.reset_tracking_after_point();
|
||||||
self.tabs[i]
|
self.tabs[i]
|
||||||
.active_cmd
|
.active_cmd
|
||||||
.as_mut()
|
.as_mut()
|
||||||
|
|
@ -7719,6 +7731,7 @@ impl OpenCADStudio {
|
||||||
self.tabs[i].dyn_active = 0;
|
self.tabs[i].dyn_active = 0;
|
||||||
self.dyn_user_reshaped = false;
|
self.dyn_user_reshaped = false;
|
||||||
self.sync_dyn_fields();
|
self.sync_dyn_fields();
|
||||||
|
self.reset_tracking_after_point();
|
||||||
let result = self.tabs[i].active_cmd.as_mut().map(|c| c.on_point(pt));
|
let result = self.tabs[i].active_cmd.as_mut().map(|c| c.on_point(pt));
|
||||||
let task = result.map(|r| self.apply_cmd_result(r))?;
|
let task = result.map(|r| self.apply_cmd_result(r))?;
|
||||||
self.refresh_active_cmd_preview(i);
|
self.refresh_active_cmd_preview(i);
|
||||||
|
|
@ -7766,6 +7779,7 @@ impl OpenCADStudio {
|
||||||
self.last_point = Some(pt);
|
self.last_point = Some(pt);
|
||||||
self.dyn_user_reshaped = false;
|
self.dyn_user_reshaped = false;
|
||||||
self.sync_dyn_fields();
|
self.sync_dyn_fields();
|
||||||
|
self.reset_tracking_after_point();
|
||||||
let result = self.tabs[i].active_cmd.as_mut().map(|c| c.on_point(pt));
|
let result = self.tabs[i].active_cmd.as_mut().map(|c| c.on_point(pt));
|
||||||
for f in self.tabs[i].dyn_fields.iter_mut() {
|
for f in self.tabs[i].dyn_fields.iter_mut() {
|
||||||
f.buffer = None;
|
f.buffer = None;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue