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 SevenandClaude Fable 5 committed 2026-07-22 16:42:14 +03:00
1 parent 51f07f1208
commit b998082c82
11 files changed
+87 -29

No files matched your search

+3 -3
View File
@@ -8,7 +8,7 @@
use acadrust::entities::Shape;
use crate::command::EntityTransform;
use crate::entities::common::{edit_prop as edit, ro_prop as ro, square_grip};
use crate::entities::common::{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, Property, PropValue};
@@ -149,9 +149,9 @@ impl PropertyEditable for Shape {
edit("Insert Y", "shp_iy", self.insertion_point.y),
edit("Insert Z", "shp_iz", self.insertion_point.z),
edit("Size", "shp_sz", self.size),
edit("Rotation", "shp_rot", self.rotation.to_degrees()),
edit_angle("Rotation", "shp_rot", self.rotation.to_degrees()),
edit("Width Factor", "shp_xs", self.relative_x_scale),
edit("Oblique Angle", "shp_ob", self.oblique_angle.to_degrees()),
edit_angle("Oblique Angle", "shp_ob", self.oblique_angle.to_degrees()),
edit("Normal X", "shp_nx", self.normal.x),
edit("Normal Y", "shp_ny", self.normal.y),
edit("Normal Z", "shp_nz", self.normal.z),