cvs: gd(GD_2_0) /libgd gd.c
[email protected] ("Mattias Bengtsson") Thu, 30 Aug 2007 19:03:54 -0000
| Newsgroups | php.gd.cvs |
|---|---|
| Message-ID | <cvsmattias1188500634@cvsserver> |
mattias Thu Aug 30 19:03:54 2007 UTC
Modified files: (Branch: GD_2_0)
/gd/libgd gd.c
Log:
-MFH #111, Optimization for single pixel line not in correct order
http://cvs.php.net/viewvc.cgi/gd/libgd/gd.c?r1=1.49.2.19&r2=1.49.2.20&diff_format=u
Index: gd/libgd/gd.c
diff -u gd/libgd/gd.c:1.49.2.19 gd/libgd/gd.c:1.49.2.20
--- gd/libgd/gd.c:1.49.2.19 Sun Aug 26 19:35:56 2007
+++ gd/libgd/gd.c Thu Aug 30 19:03:54 2007
@@ -1,4 +1,4 @@
-/* $Id: gd.c,v 1.49.2.19 2007/08/26 19:35:56 pajoye Exp $ */
+/* $Id: gd.c,v 1.49.2.20 2007/08/30 19:03:54 mattias Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -3515,14 +3515,22 @@
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);
@@ -3532,11 +3540,6 @@
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;