- #111, Optimization for single pixel line not in correct order

master
mattias 2007-08-30 19:03:06 +00:00
parent 1e3d5f1e70
commit 2c08342866
1 changed files with 13 additions and 10 deletions

View File

@ -3484,14 +3484,22 @@ static void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int co
gdImageLine(im, x1, y1, x2, y2, col);
return;
}
/* TBB: use the clipping rectangle */
if (clip_1d (&x1, &y1, &x2, &y2, im->cx1, im->cx2) == 0)
return;
if (clip_1d (&y1, &x1, &y2, &x2, im->cy1, im->cy2) == 0)
return;
/* TBB: use the clipping rectangle */
if (clip_1d (&x1, &y1, &x2, &y2, im->cx1, im->cx2) == 0)
return;
if (clip_1d (&y1, &x1, &y2, &x2, im->cy1, im->cy2) == 0)
return;
dx = x2 - x1;
dy = y2 - y1;
if (dx == 0 && dy == 0) {
/* TBB: allow setting points */
gdImageSetAAPixelColor(im, x1, y1, col, 0xFF);
return;
}
/* Axis aligned lines */
if (dx == 0) {
gdImageVLine(im, x1, y1, y2, col);
@ -3501,11 +3509,6 @@ static void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int co
return;
}
if (dx == 0 && dy == 0) {
/* TBB: allow setting points */
gdImageSetAAPixelColor(im, x1, y1, col, 0xFF);
return;
}
if (abs(dx) > abs(dy)) {
if (dx < 0) {
tmp = x1;