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