fix: respect drawing units in annotation scales
This commit is contained in:
parent
5b9fffdfba
commit
e21d4954a3
3 changed files with 29 additions and 13 deletions
|
|
@ -1144,13 +1144,16 @@ pub(super) fn on_open_file(&mut self) -> Task<Message> {
|
|||
crate::scene::text::ttf_glyph::clear_fallback_cache();
|
||||
}
|
||||
// Current model-space annotation scale comes from the drawing's
|
||||
// CANNOSCALEVALUE (paper/drawing factor); the multiplier we use
|
||||
// for text/dim sizing is its inverse (1:50 -> 0.02 -> 50.0).
|
||||
// CANNOSCALEVALUE (paper/drawing factor). Convert its inverse into
|
||||
// drawing units as well: metric annotation sizes are paper millimetres
|
||||
// and imperial annotation sizes are paper inches.
|
||||
let cannoscale_value = self.tabs[i].scene.document.header.annotation_scale_value;
|
||||
let unit_factor = self.tabs[i].scene.annotation_scale_unit_factor();
|
||||
|
||||
self.tabs[i].scene.annotation_scale = if cannoscale_value > 1e-9 {
|
||||
(1.0 / cannoscale_value) as f32
|
||||
((1.0 / cannoscale_value) / unit_factor) as f32
|
||||
} else {
|
||||
1.0
|
||||
(1.0 / unit_factor) as f32
|
||||
};
|
||||
|
||||
// Open-time breakdown so regressions are visible immediately.
|
||||
|
|
|
|||
Loading…
Reference in a new issue