mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-26 02:37:01 -06:00
A top-level <g id> becomes a layer only when it was plain, so an Inkscape layer (or our own export of a layer with a clipping mask) carrying a clip-path came in as a clip group, and a file whose layers were all clipped to one frame opened as one "Layer 1" of clip groups with the layer names lost. A top-level group that does nothing but clip its art (no mask, filter, opacity or blend) is now a layer too: its clip path becomes the layer's clipping mask (the clipping path first, as Make Clipping Mask in the Layers panel leaves it), a clip path clipped in turn nesting a clip group inside the layer as before. The clip building is shared with clip groups. Top-level text that joins a clipping layer (before or after it) isn't in its clip: the mask then becomes a clip group inside the layer and the text sits beside it. A clip path with no shape leaves the layer empty. Tests: the issue's Inkscape layers (names kept, each a clipping layer, drawn as resvg draws the SVG), a nested clip on a layer, the export -> import round trip of clipping layers, and text joining clipping layers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>