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:
Hakan Seven 2026-07-22 16:42:14 +03:00
commit b998082c82
11 changed files with 87 additions and 29 deletions

View file

@ -7,7 +7,7 @@
use acadrust::entities::{Underlay, UnderlayDisplayFlags};
use crate::command::EntityTransform;
use crate::entities::common::{center_grip, edit_prop as edit, ro_prop as ro, square_grip};
use crate::entities::common::{center_grip, edit_angle_prop as edit_angle, edit_prop as edit, ro_prop as ro, square_grip};
use crate::entities::traits::{Grippable, PropertyEditable, Transformable, TruckConvertible};
use crate::scene::convert::acad_to_truck::{TruckEntity, TruckObject};
use crate::scene::model::object::{GripApply, GripDef, PropSection, PropValue, Property};
@ -189,7 +189,7 @@ impl PropertyEditable for Underlay {
edit("Scale Z", "ul_sz", self.z_scale),
ro("Width", "ul_width", format!("{:.4}", width)),
ro("Height", "ul_height", format!("{:.4}", height)),
edit("Rotation", "ul_rot", self.rotation.to_degrees()),
edit_angle("Rotation", "ul_rot", self.rotation.to_degrees()),
],
},
PropSection {