fix(props): angle rows format via AUNITS, not LUNITS (#297)
Every angle row went through the linear formatter, so switching LUNITS
to Architectural showed a block's Rotation as feet-and-inches — and the
string wouldn't parse back, wedging the field until it was cleared and
retyped. Only the decimal/fractional LUNITS survived by accident.
New edit_angle row helper formats angles with format_angle
(AUNITS/AUPREC: decimal degrees, DMS, grads or radians), applied to all
17 angle rows (rotations, obliquing, arc start/end, hatch pattern
angle, multileader text rotation). parse_angle_deg converts every
AUNITS display form back to degrees ("30°"/"30d", DMS 30°15'20",
33.33g, 0.52r) and parse_f64 falls back to it, so the displayed value
round-trips through an edit.
Closes #297
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
51f07f1208
commit
b998082c82
11 changed files with 87 additions and 29 deletions
|
|
@ -2,7 +2,7 @@ use acadrust::entities::{BoundaryEdge, Hatch};
|
|||
use glam::Vec3;
|
||||
|
||||
use crate::command::EntityTransform;
|
||||
use crate::entities::common::{center_grip, circle_grip, edit_prop as edit, parse_f64, ro_prop as ro};
|
||||
use crate::entities::common::{center_grip, circle_grip, edit_angle_prop as edit_angle, edit_prop as edit, parse_f64, ro_prop as ro};
|
||||
use crate::entities::traits::{FallbackTess, Grippable, PropertyEditable, Transformable};
|
||||
use crate::scene::model::object::{GripApply, GripDef, PropSection, PropValue, Property};
|
||||
use crate::scene::convert::tess_util::{arc_segments, arc_signed_span, wire_chord_tol, FallbackGeometry};
|
||||
|
|
@ -250,7 +250,7 @@ fn properties(h: &Hatch) -> Vec<PropSection> {
|
|||
field: "gradient_color_2",
|
||||
value: PropValue::ColorChoice(grad_c2),
|
||||
},
|
||||
edit("Angle", "pattern_angle", g.angle.to_degrees()),
|
||||
edit_angle("Angle", "pattern_angle", g.angle.to_degrees()),
|
||||
ro("Centered", "gradient_centered", centered),
|
||||
],
|
||||
},
|
||||
|
|
@ -359,7 +359,7 @@ fn properties(h: &Hatch) -> Vec<PropSection> {
|
|||
type_row,
|
||||
pattern_name_row,
|
||||
ro("Annotative", "annotative", String::new()),
|
||||
edit("Angle", "pattern_angle", h.pattern_angle.to_degrees()),
|
||||
edit_angle("Angle", "pattern_angle", h.pattern_angle.to_degrees()),
|
||||
edit("Scale", "pattern_scale", h.pattern_scale),
|
||||
edit("Origin X", "origin_x", origin_x),
|
||||
edit("Origin Y", "origin_y", origin_y),
|
||||
|
|
|
|||
Loading…
Reference in a new issue