cvs: gd /libgd gd.c

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

  Modified files:              
    /gd/libgd	gd.c 
  Log:
  - MFB: #78,gdImageFilledRectangle() draws nothing with reversed points
    (x1,y1) > (x2,y2)
  
  
http://cvs.php.net/viewvc.cgi/gd/libgd/gd.c?r1=1.51&r2=1.52&diff_format=u
Index: gd/libgd/gd.c
diff -u gd/libgd/gd.c:1.51 gd/libgd/gd.c:1.52
--- gd/libgd/gd.c:1.51	Wed Feb  7 00:24:54 2007
+++ gd/libgd/gd.c	Sun May  6 18:12:48 2007
@@ -1,4 +1,4 @@
-/* $Id: gd.c,v 1.51 2007/02/07 00:24:54 pajoye Exp $ */
+/* $Id: gd.c,v 1.52 2007/05/06 18:12:48 pajoye Exp $ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -2096,6 +2096,17 @@
   if (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++)
     {
       for (x = x1; (x <= x2); x++)
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.