forked from 1b-agent/opencadstudio-upstream
dimensions: a radius turns with its text grip (#1675)
Dragging a radius dimension's text left the point on the arc where it was and kinked the line to reach the text. The point on the arc now follows the text round the centre, as the diameter's already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
601a97b4dd
commit
636c0917e0
1 file changed
+13
@@ -1331,6 +1331,19 @@ impl Grippable for Dimension {
|
||||
}
|
||||
}
|
||||
|
||||
// A radius turns about its centre the same way: the point on the
|
||||
// arc follows the text instead of the line kinking to reach it.
|
||||
if let Dimension::Radius(d) = self {
|
||||
let center = d.angle_vertex;
|
||||
let radius = d.measurement();
|
||||
let offset = d.base.text_middle_point - center;
|
||||
if offset.length_squared() > 1e-24 && radius > 1e-12 {
|
||||
d.definition_point = center + offset.normalize() * radius;
|
||||
d.base.definition_point = d.definition_point;
|
||||
d.base.actual_measurement = d.measurement();
|
||||
}
|
||||
}
|
||||
|
||||
// Dragging the text grip pins it to a user-defined location, so it
|
||||
// no longer follows the style (DIMTAD). See #94.
|
||||
self.base_mut().text_user_positioned = true;
|
||||
|
||||
Reference in new issue
Block a user