fix(input): command line coordinates are always absolute
A bare command-line coordinate followed the DYN setting, so with dynamic input on it was treated as relative to the last point. AutoCAD keeps the command line absolute regardless of DYN; only the DYN tooltip defaults to relative. Resolve a bare command-line value as absolute and reserve relative for the explicit `@` prefix (`#` still forces absolute). The DYN tooltip path keeps its own relative-by-default behaviour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
540d5f7b78
commit
fbac39462e
1 changed files with 7 additions and 13 deletions
|
|
@ -1278,19 +1278,13 @@ impl OpenCADStudio {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some((coord, kind)) = parse_coord(&text) {
|
if let Some((coord, kind)) = parse_coord(&text) {
|
||||||
// Resolve relative vs absolute. `@` forces relative,
|
// Command-line coordinates are absolute by default,
|
||||||
// `#` forces absolute, no prefix follows DYN: when
|
// independent of DYN: `@` forces relative, `#` forces
|
||||||
// dynamic input is on, bare coordinates are relative
|
// absolute, and a bare value is absolute. (Relative-by-
|
||||||
// to the last point (issue #26).
|
// default lives in the DYN tooltip path — see
|
||||||
// `@` forces relative, `#` forces absolute, no
|
// `dyn_resolve_point` — matching AutoCAD, where the
|
||||||
// prefix follows DYN (on → relative). The very
|
// command line stays absolute regardless of DYN.)
|
||||||
// first point has no reference, so relative falls
|
let want_relative = matches!(kind, CoordKind::Relative);
|
||||||
// back to absolute.
|
|
||||||
let want_relative = match kind {
|
|
||||||
CoordKind::Relative => true,
|
|
||||||
CoordKind::Absolute => false,
|
|
||||||
CoordKind::Default => self.dyn_input,
|
|
||||||
};
|
|
||||||
let ucs = self.tabs[i].active_ucs.clone();
|
let ucs = self.tabs[i].active_ucs.clone();
|
||||||
let wcs_pt = match (want_relative, self.last_point) {
|
let wcs_pt = match (want_relative, self.last_point) {
|
||||||
(true, Some(base)) => {
|
(true, Some(base)) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue