Commit b2bdf88
committed
Fix adaptive AA vertical edge detection
The previous implementation incorrectly checked `dx == 0` to detect
vertical edges, but dx is modified by Bresenham reduction (line 144:
dx = dx % dy). This caused diagonal lines with integer slopes to
incorrectly use the vertical optimization, resulting in thin diagonal
strokes disappearing.
Root cause identified by cubic-dev-ai review:
- dx is reduced to Bresenham remainder, losing original slope info
- Integer-slope diagonals (e.g., 45° lines where dx == dy) would
have dx==0 after modulo reduction
- These were incorrectly routed to _span_fill_vertical()
- Thin diagonal strokes collapsed due to sub-pixel span width
Fix:
- Use aa_quality flag instead of dx for vertical edge detection
- aa_quality is set from ORIGINAL dx value before Bresenham reduction
- aa_quality==0 means truly vertical edge (original dx==0)
- aa_quality==2 means needs full 4x4 AA
Testing:
- Build successful with no warnings
- mado-perf shows diagonal lines using full 4x4 AA (correct)
- Vertical lines still benefit from optimization1 parent 29e40e5 commit b2bdf88
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
387 | 391 | | |
388 | 392 | | |
389 | | - | |
| 393 | + | |
390 | 394 | | |
391 | 395 | | |
392 | 396 | | |
| |||
0 commit comments