forked from 1b-agent/opencadstudio-upstream
feat(dyn): locked input fields constrain the preview and the click (#356)
A typed dynamic-input value (TAB-locked angle or distance) now shapes the rubber-band: the cursor point is routed through dyn_resolve_point — the same resolution Enter commits — in the mouse-move preview and the click commit, so a locked 30° pins the line's direction while the free field keeps tracking the cursor. The lock wins over osnap/ortho/polar. TAB (and the comma advance) reshape the preview immediately instead of waiting for the next mouse move. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3dd27c6789
commit
7a93ba82b3
4 files changed
+39
No files matched your search
@@ -581,6 +581,15 @@ impl OpenCADStudio {
|
||||
if self.tabs[i].active_cmd.is_none() {
|
||||
return;
|
||||
}
|
||||
// Re-resolve through the locked dyn fields first so a freshly typed
|
||||
// value reshapes the preview immediately, without waiting for the
|
||||
// next mouse move (#356). Idempotent for the polar/cartesian arms, so
|
||||
// feeding the already-resolved cursor back in is stable.
|
||||
if self.tabs[i].dyn_fields.iter().any(|f| f.buffer.is_some()) {
|
||||
if let Some(r) = self.dyn_resolve_point() {
|
||||
self.tabs[i].last_cursor_world = r;
|
||||
}
|
||||
}
|
||||
let cur = self.tabs[i].last_cursor_world;
|
||||
let previews = self.tabs[i]
|
||||
.active_cmd
|
||||
|
||||
Reference in new issue
Block a user