From d81145aee3797359a92a1db77d34006d6b9e10f6 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 24 Oct 2026 03:41:59 +0700 Subject: [PATCH] Artboard documents keep objects without measurable bounds (type in a missing font) --- crates/engine/src/cmd/fileio/save.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/fileio/save.rs b/crates/engine/src/cmd/fileio/save.rs index 316f42270..170b55f88 100644 --- a/crates/engine/src/cmd/fileio/save.rs +++ b/crates/engine/src/cmd/fileio/save.rs @@ -400,11 +400,12 @@ pub(super) fn keep_art_on(d: &mut Document, r: vectorcraft_geom::Rect) { } } -/// Keep in layer `n` (and its sublayers) only the objects touching `r`. +/// Keep in layer `n` (and its sublayers) only the objects touching `r`, and those without bounds. fn keep_on(n: &mut Arc, r: vectorcraft_geom::Rect) { let touches = |b: vectorcraft_geom::Rect| b.x0 <= r.x1 && b.x1 >= r.x0 && b.y0 <= r.y1 && b.y1 >= r.y0; if let Some(children) = Arc::make_mut(n).children_mut() { - children.retain(|c| c.is_layer() || c.visual_bounds().is_some_and(touches)); + // An object whose bounds can't be measured (type in a missing font) stays: dropping it loses art. + children.retain(|c| c.is_layer() || c.visual_bounds().is_none_or(touches)); for c in children.iter_mut().filter(|c| c.is_layer()) { keep_on(c, r); }