fix: review fixes for the metric template and the radial constraint

A new drawing (#1441) recorded ISO-25 as the current dimension style by
name only. Every other place that changes it sets the header's handle as
well, and a DWG carries the current style by handle alone, so a saved new
drawing reopened on Standard. The style's handle now comes back from the
helper that adds it.

A radius constraint (#1443) anchored the circle's centre from the shape of
its references — one whole entity — but a single whole reference is also a
line's length, whose start is what stays. The entity decides now.

The two tests that encoded the replaced rules follow them: a negative
radius validates by its magnitude, as a negative distance already did, and
only zero is refused; a new drawing's dimension text reads at ISO-25's
comma separator.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5 committed 2026-09-22 13:46:49 +03:00
1 parent 6605a71fdd
commit 4bef410abb
5 files changed
+34 -10

No files matched your search

+9 -1
View File
@@ -4152,7 +4152,8 @@ mod tests {
)));
let refs = [ParametricRef::point(line, 0), ParametricRef::point(line, 1)];
// A distance keeps a negative value's sign in the parameter and
// measures its magnitude (`d1=-50`); a radius has no such reading.
// measures its magnitude (`d1=-50`); a radius reads the same way
// (`rad1=-20` is a radius of 20), and only zero leaves no circle.
assert!(scene
.validate_parametric_constraint(
ConstraintKind::Distance,
@@ -4170,6 +4171,13 @@ mod tests {
&[ParametricRef::whole(circle)],
Some(&DrivingValue::Literal(-1.0)),
)
.is_ok());
assert!(scene
.validate_parametric_constraint(
ConstraintKind::Radius,
&[ParametricRef::whole(circle)],
Some(&DrivingValue::Literal(0.0)),
)
.is_err());
assert!(scene
.validate_parametric_constraint(