forked from 1b-agent/opencadstudio-upstream
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 <[email protected]>
This commit is contained in:
1 parent
773365a1b9
commit
848f789018
1 file changed
+10
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user