mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-31 13:17:19 -06:00
PDF export (and the PDF-compatible .ai it writes) cut each gradient mesh patch into 8 x 8 flat-coloured quads. Viewers showed colour bands and hairline seams between them, and files with many meshes became very large and slow to write. An opaque mesh is now written as one Type 6 (Coons patch) shading (ISO 32000-1, 8.7.4.5.7) filling its outline, through the PDF writer's MeshGradient: each patch blends its corner colours bilinearly, as the canvas draws it. Colours go through page_color as other fills do, and a mesh mixing RGB with other models goes through RGB. A mesh with see-through points, an invalid one, or one past the coordinate range keeps the quads.