mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-03 08:49:37 -06:00
Culling a layer asked for its paint bounds, which walk its whole subtree, and then did the same for each child: every layer's subtree was walked again at each level above it, and once more in each parallel band. The bounds worked out during a render are now kept for it (layers with children only; bounds the 64-level cap cut short are not kept, and kept ones are read only where their levels still fit under the cap, so culling is exactly as before). Every render also looked through every layer of the document for the largest background blur, to size the overlap of its bands: 900 000 layers on one large file, on the main thread before the bands start. The document now works it out when first asked after a change, like whether it has masks. A 1440x900 render on a 900 000-layer file, page of 118 358 layers: at 100% 13.0 -> 0.6 ms, at 25% 16.5 -> 3.4 ms, fitted to the page 56 -> 31 ms; page of 246 204 layers: 12.6 -> 2.5 ms, 12.1 -> 2.0 ms, 69 -> 62 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YQxjkNSUJhTkTfY74aNeki