annotation: TEXT/MTEXT store the model height of their default scale

Annotative text in DWG/DXF holds the model height of its default
(native) scale representation; other scales draw it at the ratio of the
two. OCS read the stored value as paper height and multiplied it by the
annotation scale again, so text from AutoCAD came out far too small
(#1734), and annotative text OCS wrote came out too small in AutoCAD.

- Rendering uses the active/native context ratio (1 when the object has
  no representation for the displayed scale).
- TEXT with an annotative style asks for the paper height, stores the
  model height of the creation scale and gets that context; MTEXT
  starts from the model height; ANNOUPDATE converts a fixed style
  height the same way.
- Properties: the Height row of annotative TEXT and MTEXT is the paper
  height at the displayed scale, with the model height beside it, and
  an edit converts back. MTEXT shows Annotative when it has contexts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-15 08:53:31 +03:00
1 parent b221ce5e33
commit 39c3e9af58
8 files changed
+183 -101

No files matched your search

+23
View File
@@ -4179,6 +4179,29 @@ impl OpenCADStudio {
}
}
}
// Annotative text: the row holds the paper height.
"height"
if self.tabs[i]
.scene
.annotative_text_height_factor(handle)
.is_some() =>
{
let factor = self.tabs[i]
.scene
.annotative_text_height_factor(handle)
.unwrap_or(1.0);
if let (Ok(paper), Some(entity)) = (
val.trim().parse::<f64>(),
self.tabs[i].scene.document.get_entity_mut(handle),
) {
crate::scene::view::dispatch::apply_geom_prop_in_working_plane(
entity,
"height",
&(paper * factor).to_string(),
plane,
);
}
}
"hyperlink" => {
// Stored in the standard PE_URL XDATA
// record; an empty value clears it.