From dc26c8128cddd2a787ab89d8f09ff27c237ab4c8 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Fri, 12 Jun 2026 14:15:53 +0300 Subject: [PATCH] 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 --- src/app/update.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/app/update.rs b/src/app/update.rs index f46dcd805..bd235a827 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -74,6 +74,15 @@ impl OpenCADStudio { 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. pub(super) fn current_settings(&self) -> super::settings::UserSettings { super::settings::UserSettings { @@ -1263,6 +1272,7 @@ impl OpenCADStudio { self.last_point = Some(pt); self.dyn_user_reshaped = false; self.sync_dyn_fields(); + self.reset_tracking_after_point(); let result = self.tabs[i].active_cmd.as_mut().map(|c| c.on_point(pt)); if let Some(r) = result { let task = self.apply_cmd_result(r); @@ -1309,6 +1319,7 @@ impl OpenCADStudio { self.last_point = Some(wcs_pt); self.dyn_user_reshaped = false; 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)); if let Some(r) = result { let task = self.apply_cmd_result(r); @@ -3259,6 +3270,7 @@ impl OpenCADStudio { self.last_point = Some(world_pt); self.dyn_user_reshaped = false; self.sync_dyn_fields(); + self.reset_tracking_after_point(); self.tabs[i] .active_cmd .as_mut() @@ -7719,6 +7731,7 @@ impl OpenCADStudio { self.tabs[i].dyn_active = 0; self.dyn_user_reshaped = false; 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 task = result.map(|r| self.apply_cmd_result(r))?; self.refresh_active_cmd_preview(i); @@ -7766,6 +7779,7 @@ impl OpenCADStudio { self.last_point = Some(pt); self.dyn_user_reshaped = false; self.sync_dyn_fields(); + self.reset_tracking_after_point(); 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() { f.buffer = None;