Skip to content

Commit

Permalink
Speed up code by only checking other edges at the end of this edge
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jan 3, 2025
1 parent 61e94bd commit ee138b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libImaging/Draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ polygon_generic(
// Needed to draw consistent polygons
xx[j] = xx[j - 1];
j++;
} else if (current->dx != 0 && j % 2 == 1 &&
} else if ((ymin == current->ymin || ymin == current->ymax) &&
current->dx != 0 && j % 2 == 1 &&
roundf(xx[j - 1]) == xx[j - 1]) {
// Connect discontiguous corners
for (k = 0; k < i; k++) {
Expand Down

0 comments on commit ee138b6

Please sign in to comment.