forked from 1b-agent/opencadstudio-upstream
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
6605a71fdd
commit
4bef410abb
5 files changed
+34
-10
No files matched your search
@@ -732,8 +732,15 @@ pub(crate) fn dimensional_anchor_refs(
|
||||
return Vec::new();
|
||||
};
|
||||
// A whole circle or arc (a radius or diameter): its center stays and the
|
||||
// value resizes it.
|
||||
if refs.len() == 1 && first.marker.is_none() {
|
||||
// value resizes it. A single whole reference can also be a line's length,
|
||||
// whose start is what stays, so the entity decides.
|
||||
if refs.len() == 1
|
||||
&& first.marker.is_none()
|
||||
&& matches!(
|
||||
document.get_entity(first.entity),
|
||||
Some(acadrust::EntityType::Circle(_) | acadrust::EntityType::Arc(_))
|
||||
)
|
||||
{
|
||||
return vec![ParametricRef::center(first.entity)];
|
||||
}
|
||||
// Three point references: a three-point angle `[first, vertex, second]`.
|
||||
|
||||
Reference in new issue
Block a user