mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-13 22:32:19 +00:00
`degenerate_fill_area` took a side under 1/256 unit as zero, so a thin rectangle with area that the CTM scales up to whole pixels (100 x 1/1024 under a 4096x vertical scale covers four device rows) was clipped and filled as a one-pixel band along its bounding-box diagonal. The fill fallback had the same threshold and stroked it as a hairline. Both now treat only an exactly zero side as degenerate; a box with area is filled and clipped as the shape it is. A slanted zero-height line less than a pixel high was snapped to its whole bounding box, marking both rows along its full length when it crossed a row boundary. Whole-pixel snapping is now used only when the line stays within one device row or column (a line under 1/256 pixel across is taken at its middle); otherwise it is the one-pixel band, so each row is marked only where the line runs through it (ISO 32000-2 §10.7.4, half-open pixel squares the shape intersects). Tests: crates/render/tests/it/zero_area_fill_clip.rs a_thin_rectangle_scaled_up_to_whole_pixels_keeps_its_area and a_slanted_zero_height_line_crossing_a_row_marks_each_row_only_where_it_runs each fail with their part of the fix reverted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC