From 848f789018ff30dd4069b5a097b789cd7be70982 Mon Sep 17 00:00:00 2001 From: Christopher Overbeck Date: Tue, 15 Sep 2026 12:36:44 -0500 Subject: [PATCH] Stamp the layout owner so compensated text survives every commit path The negative DIMLFAC convention is resolved from the dimension's owner block, but the entity only gets one when `add_entity_to_layout` commits it. With DIMASSOC = 0 the dimension is exploded to its pieces first, and the baked text would then have read as a model-space dimension and dropped the compensation. Stamp the layout block - the same handle the add assigns - as soon as the override is written, so the entity is self-describing whichever path consumes it. Co-Authored-By: Claude Fable 5.1 --- src/app/dim_viewport.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/dim_viewport.rs b/src/app/dim_viewport.rs index 55a84961a..632ed364d 100644 --- a/src/app/dim_viewport.rs +++ b/src/app/dim_viewport.rs @@ -209,6 +209,16 @@ impl OpenCADStudio { if let Some(value) = MeasurementScale::viewport_dimlfac_override(style_dimlfac, compensation) { + // The negative DIMLFAC convention is resolved from the dimension's + // owner block, and the commit path (or, with DIMASSOC = 0, the + // explode path) reads the entity before `add_entity_to_layout` + // assigns one. Stamping the layout block here — the same handle + // the add would set — keeps the entity self-describing, so the + // text is compensated whichever path consumes it. + let layout_block = self.tabs[i].scene.current_layout_block_handle_pub(); + if layout_block.is_valid() { + entity.common_mut().owner_handle = layout_block; + } dim_override::set_on_entity( entity, dim_override::DIMLFAC,