forked from 1b-agent/opencadstudio-upstream
Add a Drafting page for the rotation angle and the polar increment
Two drafting preferences had no proper home. The Drafting Settings dialog displays the drafting rotation and offers only a Reset button — there was no way to type an angle short of `SETVAR SNAPANG`. The polar tracking increment existed in exactly one place: a pop-up hanging off the status-bar pill. The rotation is a text field over an edit buffer rather than the value itself, so clearing it to retype does not snap the crosshair to zero on the way through; the buffer is reseeded whenever the value is restored from behind it. Angles render without a trailing `.0`, matching how the polar pop-up has always shown them — same kind of number, same reader. Snap modes, grid spacing and object snap stay in Drafting Settings, where they belong; the page links to it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9c3f3625da
commit
b5f4b4d1cc
6 files changed
+123
No files matched your search
@@ -145,6 +145,18 @@ pub(crate) fn snaps_from_osmode(osmode: i32) -> (Vec<SnapType>, bool) {
|
||||
(modes, osmode & OSMODE_SUPPRESS == 0)
|
||||
}
|
||||
|
||||
/// Render a drafting angle without a trailing `.0`, so `22.5` but `30`.
|
||||
///
|
||||
/// The polar pop-up formats its presets the same way; both are showing the
|
||||
/// same kind of number to the same person.
|
||||
pub fn format_snap_angle(deg: f32) -> String {
|
||||
if (deg - deg.round()).abs() < 1e-4 {
|
||||
format!("{}", deg.round() as i32)
|
||||
} else {
|
||||
format!("{deg}")
|
||||
}
|
||||
}
|
||||
|
||||
/// GRIPOBJLIMIT default: past this many selected objects, no grips are drawn.
|
||||
pub const DEFAULT_GRIP_OBJECT_LIMIT: i32 = 100;
|
||||
|
||||
|
||||
Reference in new issue
Block a user