mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-29 01:34:37 +01:00
SVG, PNG, PDF and Vector Drawable exports took their size from the renderer's bounds, and Node::outline_reach grows a line's, vector's or polygon's box by the weight times the miter limit (up to 4) to leave room for a mitre at any corner. An icon frame whose outlined strokes stay inside it exported at 26 x 26 to 30.8 x 24 instead of 24 x 24, its content moved off the frame's origin. export_bounds now walks the tree as world_render_bounds does (Document::world_render_bounds_with) and measures each layer's own paint on the outlines it draws: its shape and its stroke area from stroke_fill, in page space, grown by its effects. A dashed stroke counts as a solid one as well as its dashes, so where the dashes fall doesn't change the size. Text and drop shadows with a spread keep the renderer's bounds. The renderer's own bounds, used for drawing and culling, are unchanged. Shrinking outline_reach itself was rejected: the renderer culls and caches by it, and an exact stroke there would cost a stroke outline per layer per bounds query.