mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-27 11:37:59 -06:00
FredApps's note on #3327: five points that are all on the bounding box's corners still need not trace the rectangle. Three sides and a step back along the third -- 10 10 m 30 10 l 30 30 l 10 30 l 30 30 l S -- visits every corner, so it was taken as the box and stroked with a left side the path does not have. path_as_rect now asks what a rectangle actually is: four distinct points, each step from one to the next along a single axis, and the last point back at the first (written as the fourth LineTo or as ClosePath). That is a rectangle and nothing else is, so the corner test and its off_corner flag are gone -- four points of an axis-aligned traversal are necessarily the corners of their own bounding box. A degenerate path, whose points are not distinct, now takes the general route as well, where it painted a zero-width or zero-height rectangle before. The vendored-patch table has the row this change was missing: without it a re-vendor of hayro-interpret would drop the patch silently, which is the other half of FredApps's review.