From 636c0917e0056447c2b959a459337992e4300380 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 15 Oct 2026 01:41:32 +0300 Subject: [PATCH] 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 --- src/entities/dimension.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/entities/dimension.rs b/src/entities/dimension.rs index fd021e0f2..ad75c60af 100644 --- a/src/entities/dimension.rs +++ b/src/entities/dimension.rs @@ -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;