mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-09 12:32:52 +00:00
- The widened appearance box and /Rect reach the /QuadPoints only as far as the page's visible region (crop box within media box, ISO 32000-2 §14.11.2), never shrink /Rect, and are not widened at all by quads wholly off the page or by more than MAX_MARKUP_QUADS (10,000) quadrilaterals (counted before the numbers are read). - One /Rect normalisation (normalised_rect) for appearance_context and the reach; markup_reach takes the normalised /Rect and the page box, and apply_appearance takes the saved /Rect from the built /BBox (widened_rect) instead of computing the reach a second time. - Tests: the restyle (set_appearance) path saves the widened /Rect, stops at the page and keeps a fitting /Rect as written; a markup with its own /AP and a non-markup subtype are not widened; crop box and cap cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>