Browse Source

- add some basic optimisations, usefull when you draw many horizontal or

vertical lines like in charts
migration/RELEASE_1_0_0
Pierre Joye 21 years ago
parent
commit
3afdc2e490
  1. 16
      ext/gd/libgd/gd.c

16
ext/gd/libgd/gd.c

@ -1029,6 +1029,22 @@ void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
return;
}
/* Vertical */
if (x1==x2) {
for (;y1 <= y2; y1++) {
gdImageSetPixel(im, x1,y1, color);
}
return;
}
/* Horizontal */
if (y1==y2) {
for (;x1 <= x2; x1++) {
gdImageSetPixel(im, x1,y1, color);
}
return;
}
/* gdAntiAliased passed as color: set anti-aliased line (AAL) global vars. */
if (color == gdAntiAliased) {
im->AAL_x1 = x1;

Loading…
Cancel
Save