mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
A PDF, and the PDF part of a PDF-compatible .ai, writes a shape filled with a gradient as a clip followed by a shading fill: the shape, W n, then sh, which fills the clip's bounds. The importer kept that as a clip group of the shape (a clipping path) and a rectangle the size of its bounds filled with the gradient. The Shape Builder skips clipping paths, so it built its pieces from the rectangles: two overlapping gradient-filled diamonds gave three rectangles. The Fill swatch showed ? for such a selection, since it held groups. A clip whose only content is one rectangle covering the clip, filled with a gradient placed on the page and nothing else, now comes in as one path: the clip's outline, its subpaths closed, with the rectangle's fill, opacity, blend mode and mask. It draws as before and edits like a gradient-filled path drawn in the app. Clips holding anything else (a flat colour, several objects, a gradient that doesn't cover the clip, a shading that doesn't extend past its ends) stay clip groups. Tests: a diamond clipping a shading imports as one closed path of four anchors with the linear gradient where it was, and a gradient covering only part of the diamond or a flat colour stay clipped. Two overlapping diamonds in a hand-written PDF, clicked on their overlap with the Shape Builder, give what is left of each (9000 pt² each) and the overlap diamond (3000 pt²), each with its gradient; main gave three rectangles of 12000 pt². Co-Authored-By: Claude Opus 5.5 <[email protected]>