cvs: gd(GD_2_0) /libgd gd.c

[email protected] ("Pierre-Alain Joye")
Newsgroups php.gd.cvs
Message-ID <cvspajoye1178482321@cvsserver>
pajoye		Sun May  6 20:12:01 2007 UTC

  Modified files:              (Branch: GD_2_0)
    /gd/libgd	gd.c 
  Log:
  - #78, gdImageFilledRectangle with reversed edges does not work
  
  
http://cvs.php.net/viewvc.cgi/gd/libgd/gd.c?r1=1.49.2.7&r2=1.49.2.8&diff_format=u
Index: gd/libgd/gd.c
diff -u gd/libgd/gd.c:1.49.2.7 gd/libgd/gd.c:1.49.2.8
--- gd/libgd/gd.c:1.49.2.7	Thu Apr 26 15:52:41 2007
+++ gd/libgd/gd.c	Sun May  6 20:12:01 2007
@@ -1,4 +1,4 @@
-/* $Id: gd.c,v 1.49.2.7 2007/04/26 15:52:41 pajoye Exp $ */
+/* $Id: gd.c,v 1.49.2.8 2007/05/06 20:12:01 pajoye Exp $ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -2145,13 +2145,24 @@
      nicely kills any plotting for rectangles completely outside the
      window as it makes the tests in the for loops fail */
   if (x1 < 0)
-    x1 = 0;
+	  x1 = 0;
   if (x1 > gdImageSX (im))
-    x1 = gdImageSX (im);
+	  x1 = gdImageSX (im);
   if (y1 < 0)
-    y1 = 0;
+	  y1 = 0;
   if (y1 > gdImageSY (im))
-    y1 = gdImageSY (im);
+	  y1 = gdImageSY (im);
+
+  if (x1 > x2) {
+	  x = x1;
+	  x1 = x2;
+	  x2 = x;
+  }
+  if (y1 > y2) {
+	  y = y1;
+	  y1 = y2;
+	  y2 = y;
+  }
 
   for (y = y1; (y <= y2); y++)
     {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.