mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-30 04:58:34 -06:00
An image or a nested group is drawn into a layer of its own, which covers the whole canvas (transparent where nothing was drawn), so it can't be composited with Compose::Copy. What is under its shape is now cleared first and the layer then composites over it: - an unmasked image's shape is its placement rectangle: the interpreter hands it to the device (`Device::knockout_shape`), which clears it with a transparent Copy fill; - a nested group's shape is the union of its elements' shapes: the interpreter draws its content once in the device's erase mode (`knockout_erase_wanted`, `begin_knockout_erase`, `end_knockout_erase`), where every paint clears under its shape and nothing is layered or drawn as an image, and then draws the group, always in a layer of its own (drawn straight onto the knockout group, its own elements knocked each other out). A masked image's shape is its mask; it composites as before, which matches MuPDF where the mask is opaque or transparent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RUNQSPVXx3dDBabRZHAnjz