mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-07 14:33:34 +00:00
The enabled check of artboard.deleteEmpty built the full list of empty artboards, measuring the visual bounds of the art against every artboard, each time the Artboards panel menu was drawn. It now returns false at once in a document with one artboard (that artboard is never deleted). With two or more, it asks the new Document::any_artboard_without_art whether any unlocked artboard has no art, which is the same answer as a non-empty list. Document::any_artboard_without_art builds the symbol boxes once for all the artboards and first tests each path and compound path by a quick box: its control points' box grown by the farthest its strokes reach (Appearance::outset), with a margin for rounding. An artboard that no quick box meets is reported empty without measuring along any path. Only when every artboard may hold art is each one measured. Document::artboard_has_art also skips measuring an object whose quick box misses the artboard; its answers are unchanged. The check of gradient.presets.save found the proxy paints through Node::proxy_paint, which measures the object's geometric bounds for a gradient box the check does not use. Node::proxy_paint_only picks the same paint without measuring, and the engine's proxy_paint uses it, so the Fill and Stroke proxies and the mixed-paint test no longer measure each object either. With an open stroked path of 200,000 anchors selected, the two checks take under 0.01 ms instead of 21.9 ms and 17.2 ms in a release build, and Delete Empty Artboards' check takes 0.85 ms instead of 42.1 ms with a second, empty artboard. Tests compare each check with what its command does (one artboard, all empty, one empty, locked empty, nested art; with and without a gradient), compare any_empty_artboards with the previous check and with measuring every object on 120 seeded documents, compare the quick boxes with the visual bounds on seeded strokes, and compare proxy_paint_only with proxy_paint on seeded objects. Docs: docs/target-app-parity.md, one line under Delete Empty Artboards.