mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-10 14:41:51 +00:00
XFA 3.3 p. 38 gives a border's corners in the order top-left, top-right, bottom-right, bottom-left, as its edges go top, right, bottom, left, and says that when fewer than four are listed the last one listed is reused for the rest. Readers don't do that: every reader tested draws a side not listed from the edge or corner on the same side, one listed serving all four sides, two alternating (0, 1, 0, 1), three reusing the second for the fourth (0, 1, 2, 1). The layout already drew edges the readers' way, but drew corners as p. 38's text says, so with corners [round, square] only the top-left was round where readers round the top-left and the bottom-right. Corners now follow the readers too, through one helper, drawn_side, that edges and corners share: with [round, square] the top-left and bottom-right are round and the top-right and bottom-left square. Edges are drawn as before. The scripting host's reads of a corner past those listed (from the previous commit) mirror the same pattern, so a script reads the corner the page draws. Real forms (358 public forms with XFA, templates read through the engine): 337 borders in 51 forms list two or three corners that differ, all only in a square corner's presence, which the layout doesn't draw differently; none has a rounded or inverted corner that would move, so no rendered page changes. Tests: one, two and three corners, two in both orders, and the rounded-corners test's two-corner box (now [r1, r2, r1, r2]) fail with the change reverted; a script test reads corners past those listed by the same pattern. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CBVyQEwtmEw3mS1MoAiwrK