forked from 1b-agent/opencadstudio-upstream
fix(dyn-input): support cartesian coords via "," (#35)
Typing \`,\` while DYN was on appended the character to the focused field's buffer (treated as a European decimal point), so users couldn't switch to cartesian coordinates mid-command. The dynamic input was stuck in polar \`[Distance, Angle]\` whenever a base point existed. \`,\` now acts as the coordinate separator (matching the AutoCAD convention): pressing it locks the current field's buffer, then either advances within the existing cartesian set or reshapes a polar configuration into cartesian: - \`[Distance, Angle]\` + \`,\` on the first field → \`[X(buf), Y]\` - \`[X, Y]\` + \`,\` on Y → \`[X, Y, Z]\` - otherwise advances to the next field (Tab-equivalent) \`sync_dyn_fields\` accepts both polar and cartesian shapes as valid \`Point\` configurations so a mouse-move after the reshape doesn't revert to polar. \`dyn_resolve_point\` and the overlay's live-value formatter treat cartesian inputs as RELATIVE to the base point when one exists — matching the DYN-on relative-coords convention from #26. \`DynComponent::Z\` plus its label / value paths fill out the 3-D variant. Closes #35 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c60dce81a
commit
f952fc9bb7
3 files changed
+125
-4
No files matched your search
@@ -20,6 +20,9 @@ pub(super) enum DynComponent {
|
||||
X,
|
||||
/// Absolute Y ordinate.
|
||||
Y,
|
||||
/// Absolute Z ordinate (only visible after the user types a second
|
||||
/// `,` separator from a cartesian X/Y configuration).
|
||||
Z,
|
||||
/// Linear distance from the last point.
|
||||
Distance,
|
||||
/// Angle from the last point, in degrees.
|
||||
|
||||
Reference in new issue
Block a user