forked from 1b-agent/opencadstudio-upstream
feat(dynamic-input): per-step specs for rectangle, polygon and ellipse
Extend the DynSpec coverage and add the guides those commands need: - Rectangle: two-corner enters width/height as unsigned magnitudes (the sign follows the cursor side, like the angle entry), drawn with the rectangle as the guide; rotated rectangle's height is a single distance measured square to the base edge (dimension line offset off the edge with extension lines); centre rectangle shows half-width/half-height. - Polygon: inscribed/circumscribed vertex step shows radius + rotation. - Ellipse: minor-axis step (all three modes) measures the half-length perpendicular to the major axis and draws that semi-axis from the centre; angle steps anchor their arc at the centre. Adds DynGuide::Perp / PerpDim (perpendicular measure to a reference line) and DynSpec::ref_point, plus Width/Height role handling (unsigned display, cursor-signed commit) and diameter value scaling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
b0ee1c39bd
commit
e31dbcb5c4
8 files changed
+296
-10
No files matched your search
@@ -132,6 +132,11 @@ pub(super) struct DocumentTab {
|
||||
/// World-space anchor the current step's values are measured from. `None`
|
||||
/// falls back to `App::last_point`.
|
||||
pub(super) dyn_anchor: Option<glam::Vec3>,
|
||||
/// Far end of a reference line through `dyn_anchor` (for the `Perp` guide:
|
||||
/// the base edge / major axis the offset is measured square to).
|
||||
pub(super) dyn_ref: Option<glam::Vec3>,
|
||||
/// `dyn_ref` projected to viewport pixels.
|
||||
pub(super) dyn_ref_screen: Option<iced::Point>,
|
||||
/// Index of the field that TAB has focused (the one keystrokes edit).
|
||||
pub(super) dyn_active: usize,
|
||||
pub(super) history: HistoryState,
|
||||
@@ -195,6 +200,8 @@ impl DocumentTab {
|
||||
dyn_fields: Vec::new(),
|
||||
dyn_guide: crate::command::DynGuide::Polar,
|
||||
dyn_anchor: None,
|
||||
dyn_ref: None,
|
||||
dyn_ref_screen: None,
|
||||
dyn_active: 0,
|
||||
history: HistoryState::default(),
|
||||
active_layer: "0".to_string(),
|
||||
|
||||
Reference in new issue
Block a user