forked from 1b-agent/opencadstudio-upstream
fix(dyn-input): re-sync fields immediately after point commits (#35)
`sync_dyn_fields` only ran during `ViewportMove`, so a typed-coord or click-driven point commit left the previous iteration's field shape in place until the user nudged the mouse. After the first LINE click that meant the stale `[X, Y]` (built when there was no base) kept serving the next point's input as cartesian even though the command-default for a "Point with base" is now polar `[Distance, Angle]`. The original #35 fix preserved a `,`-reshaped cartesian set on purpose, but the same machinery now also held onto a never-explicitly-chosen `[X, Y]` carried over from "no base" → "has base". Track that intent explicitly with `dyn_user_reshaped` (set in `dyn_comma_advance`, cleared on point commit and command start) and only treat a non-matching shape as acceptable while that flag is on. Re-run `sync_dyn_fields` from every point-commit path (command-line typed coord, mouse click, dynamic-input locked commit) so the freshly updated `has_base` state immediately picks the right default and the user sees polar fields without having to move the mouse first.
This commit is contained in:
1 parent
f952fc9bb7
commit
8f02e1ca07
3 files changed
+40
-12
No files matched your search
@@ -88,6 +88,12 @@ pub(super) struct OpenCADStudio {
|
||||
/// edge, updated on move, cleared on release (which also runs the
|
||||
/// collapse pass).
|
||||
tile_drag: Option<TileDrag>,
|
||||
/// `true` once the user has reshaped the dynamic-input field set via
|
||||
/// the `,` separator during the current command iteration. Tells
|
||||
/// `sync_dyn_fields` to preserve the user's chosen shape instead of
|
||||
/// reverting to the command-default when `has_base` flips. Cleared
|
||||
/// on point commit / command start. See #35.
|
||||
dyn_user_reshaped: bool,
|
||||
/// Show the UCS icon in the bottom-left corner of model space (UCSICON).
|
||||
show_ucs_icon: bool,
|
||||
/// Whether the ViewCube 3D gizmo is visible in model space (NAVVCUBE).
|
||||
@@ -763,6 +769,7 @@ impl OpenCADStudio {
|
||||
dyn_input: true,
|
||||
awaiting_vports: false,
|
||||
tile_drag: None,
|
||||
dyn_user_reshaped: false,
|
||||
show_ucs_icon: true,
|
||||
show_viewcube: true,
|
||||
show_properties: true,
|
||||
|
||||
Reference in new issue
Block a user