forked from 1b-agent/opencadstudio-upstream
fix(annotative): start new drawings at the unit-aware annotation scale
A new drawing is metric with metre insertion units, but its annotation multiplier stayed at Scene::new()'s unitless 1 while opened files and CANNOSCALE convert paper millimetres into drawing units (0.001 at 1:1). Annotative text and dimensions were drawn 1000x too large until the first scale change, then shrank to their real size and looked gone, also after switching back to 1:1. One helper now derives the multiplier from the header; new drawings, file open and every INSUNITS change (UNITS, the units popup, DWGUNITS, SETVAR) go through it. Fixes #1674 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
85627ebc8a
commit
5d0390bcdf
6 files changed
+31
-31
No files matched your search
@@ -3090,6 +3090,10 @@ impl Scene {
|
||||
// The name alone leaves the header pointing at the previous style, and
|
||||
// a DWG writes the current style by handle only.
|
||||
self.document.header.current_dimstyle_handle = iso;
|
||||
// The annotation multiplier depends on those units; Scene::new()
|
||||
// left it at the unitless 1, which drew annotative objects 1000x too
|
||||
// large until the first CANNOSCALE change shrank them. (#1674)
|
||||
self.sync_annotation_scale_from_header();
|
||||
for obj in self.document.objects.values_mut() {
|
||||
if let codec::objects::ObjectType::Layout(l) = obj {
|
||||
if l.name != "Model" {
|
||||
|
||||
Reference in new issue
Block a user