forked from 1b-agent/opencadstudio-upstream
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
b221ce5e33
commit
39c3e9af58
8 files changed
+183
-101
No files matched your search
@@ -1608,12 +1608,14 @@ impl OpenCADStudio {
|
||||
}
|
||||
self.push_undo_snapshot(i, "ANNOUPDATE");
|
||||
let scale = self.tabs[i].scene.creation_annotation_scale_handle();
|
||||
let paper_to_model = self.tabs[i].scene.creation_annotation_multiplier();
|
||||
let mut updated = 0usize;
|
||||
for handle in &handles {
|
||||
if crate::scene::annotative::update_entity_from_annotation_style(
|
||||
&mut self.tabs[i].scene.document,
|
||||
*handle,
|
||||
scale,
|
||||
paper_to_model,
|
||||
) {
|
||||
updated += 1;
|
||||
}
|
||||
|
||||
@@ -2697,6 +2697,16 @@ impl OpenCADStudio {
|
||||
.header
|
||||
.current_text_style_name
|
||||
.clone();
|
||||
// An annotative style's default height is on paper; the editor
|
||||
// and the entity work in the model height of this scale.
|
||||
let height = if crate::scene::annotative::text_style_is_annotative(
|
||||
&self.tabs[i].scene.document,
|
||||
&style,
|
||||
) {
|
||||
height * self.tabs[i].scene.creation_annotation_multiplier()
|
||||
} else {
|
||||
height
|
||||
};
|
||||
let new_cmd = MTextCommand::with_defaults(height, style);
|
||||
self.command_line.push_info(&new_cmd.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(new_cmd));
|
||||
|
||||
Reference in new issue
Block a user