feat(statusbar): honor $COORDS in the coordinate readout, click to cycle

The Coords pill always showed live absolute X,Y,Z, ignoring the drawing's
$COORDS (coords_mode) sysvar. Drive the readout from it:

- 0 static  — the last picked point; the readout freezes between picks.
- 1 live    — continuous absolute X,Y,Z (previous behavior, default).
- 2 polar   — distance<angle relative to the last point while a command is
              prompting for a point; absolute otherwise.

The cursor and last point are reported in the active UCS, matching the rest of
the readout. Clicking the pill cycles the mode 0→1→2→0 (CycleCoordsMode), marks
the tab dirty and echoes it; SETVAR COORDS still works. $COORDS round-trips per
drawing via acadrust's coords_mode.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-10 15:54:57 +03:00
1 parent 6bbd88153b
commit 71db52a0a4
4 files changed
+66 -8

No files matched your search

+20
View File
@@ -1541,6 +1541,26 @@ impl OpenCADStudio {
}
Task::none()
}
Message::CycleCoordsMode => {
// $COORDS 0 (static) → 1 (live absolute) → 2 (polar) → 0.
let i = self.active_tab;
if i < self.tabs.len() {
let mode = {
let h = &mut self.tabs[i].scene.document.header;
h.coords_mode = (h.coords_mode + 1).rem_euclid(3);
h.coords_mode
};
self.tabs[i].dirty = true;
let label = match mode {
0 => "static",
2 => "polar",
_ => "live",
};
self.command_line
.push_output(&format!("COORDS = {mode} ({label})"));
}
Task::none()
}
Message::TogglePolar => {
self.polar_mode ^= true;
if self.polar_mode {