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
@@ -517,6 +517,9 @@ pub(super) struct OpenCADStudio {
|
||||
crosshair_color: Option<[u8; 3]>,
|
||||
/// Editable Options buffer for the crosshair colour.
|
||||
crosshair_color_input: String,
|
||||
/// Edit buffer for the SNAPANG field on the Options Drafting page. Kept
|
||||
/// separate from `snap_angle_deg` so a half-typed angle is not parsed.
|
||||
snap_angle_input: String,
|
||||
/// Model-space lineweight preview scale, in percent (25..=200).
|
||||
lineweight_display_scale: i32,
|
||||
/// Isometric drafting state and active axis pair.
|
||||
@@ -2029,6 +2032,10 @@ pub enum Message {
|
||||
QdimSnapPriorityChanged(u8),
|
||||
/// Change which annotative objects pick up a new scale (ANNOAUTOSCALE).
|
||||
AnnoAutoScaleChanged(i8),
|
||||
/// Edit the drafting rotation field; parsed when it holds a valid angle (SNAPANG).
|
||||
SnapAngleInputChanged(String),
|
||||
/// Change the polar tracking increment in degrees.
|
||||
PolarIncrementChanged(f32),
|
||||
/// Restore Model Space display/canvas appearance to defaults.
|
||||
RestoreModelSpaceDisplayDefaults,
|
||||
/// Restore Selection visual effect settings to defaults.
|
||||
@@ -3429,6 +3436,7 @@ impl OpenCADStudio {
|
||||
cursor_type: settings::CursorType::Crosshair,
|
||||
crosshair_color: None,
|
||||
crosshair_color_input: String::new(),
|
||||
snap_angle_input: "0".to_string(),
|
||||
lineweight_display_scale: 100,
|
||||
isometric_drafting: false,
|
||||
iso_plane: settings::IsoPlane::Left,
|
||||
|
||||
Reference in new issue
Block a user