You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gfx: polyLineT28 drops a carry for very large edges (32*D*|B| >= 2^64) #5286
polyLineT28 in src/fl/gfx/poly_abuffer.h deliberately reproduces a carry-drop from an earlier quotient loop. When 32*D*|B| >= 2^64, the computed edge coverage is wrong, which gives wrong antialiasing. Polygon coordinates are clamped to ±8191 px, so this needs edges of roughly 2900 px or more in both x and y. That is reachable through the public API.
The existing tests pin outputs produced with the carry-drop in place, so fixing it changes pinned values.
Proposed fix
Write a test with an edge large enough to trigger the carry-drop, compared against a wide-precision reference (for example double, or 128-bit on the host).
Fix the quotient loop so it propagates the carry, or does the division in a form that cannot overflow.
Re-pin any outputs that change, and explain each change in the PR.
Check that AVR code size and speed don't regress: the common, small-edge path must stay at least as fast.
Activity
fix(gfx): exact polyLineT28 quotient for huge edges (den >= 2^63) (Fa…