Symbols: Reset Transformation keeps the art's size when the stored size is not positive

This commit is contained in:
dotCooCoo
2026-11-08 12:21:14 +07:00
committed by bflatastic
parent 98265b7435
commit 1cd607f596
3 changed files with 24 additions and 2 deletions
+2 -2
View File
@@ -710,8 +710,8 @@ pub fn reset_transformation(boxes: &vectorcraft_doc::SymbolBoxes, n: &Node) -> O
if n.extras().perspective.is_some() || !d.symbols.iter().any(|s| s.name == *symbol) {
return None;
}
let (w, h) = natural_size(d, symbol);
let scale = Affine::scale_non_uniform(w / (2.0 * HALF), h / (2.0 * HALF));
// The symbol's stored natural size, or the art unscaled when that size is not positive and finite.
let scale = d.symbol_natural_xf(symbol);
// The art's box in symbol space (the ±HALF square when the art cannot be measured): its
// center keeps its place on the page.
let art = boxes.art_bounds(symbol).unwrap_or_else(|| vectorcraft_geom::Rect::new(-HALF, -HALF, HALF, HALF));