[mapserver-commits] r7957 - branches/branch-5-2/mapserver

svn at osgeo.org svn at osgeo.org
Sat Oct 4 11:45:36 EDT 2008


Author: tbonfort
Date: 2008-10-04 11:45:36 -0400 (Sat, 04 Oct 2008)
New Revision: 7957

Modified:
   branches/branch-5-2/mapserver/HISTORY.TXT
   branches/branch-5-2/mapserver/mapagg.cpp
Log:
fix a bug with shapes with duplicate end points. was causing NaNs in the angle follow placement code (#2695)


Modified: branches/branch-5-2/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-2/mapserver/HISTORY.TXT	2008-10-04 15:37:16 UTC (rev 7956)
+++ branches/branch-5-2/mapserver/HISTORY.TXT	2008-10-04 15:45:36 UTC (rev 7957)
@@ -12,6 +12,8 @@
 
 Current Version (SVN branch-5-2)
 --------------------------------
+- fix a bug with shapes with duplicate end points. was causing NaNs 
+  in the angle follow placement code (#2695)
 
 - memory leak in msInsertLayer, from Ned Horning (#2784)
 

Modified: branches/branch-5-2/mapserver/mapagg.cpp
===================================================================
--- branches/branch-5-2/mapserver/mapagg.cpp	2008-10-04 15:37:16 UTC (rev 7956)
+++ branches/branch-5-2/mapserver/mapagg.cpp	2008-10-04 15:45:36 UTC (rev 7957)
@@ -2451,10 +2451,13 @@
                 if(dx*dx+dy*dy>1)
                     k++;
             }
-            /*always keep last point*/
             point[k].x = MS_MAP2IMAGE_X_IC_DBL(point[j].x, extent.minx, inv_cs);
             point[k].y = MS_MAP2IMAGE_Y_IC_DBL(point[j].y, extent.maxy, inv_cs);
-            shape->line[i].numpoints=k+1;
+            if(point[k].x!=point[k-1].x || point[k].y!=point[k-1].y) { 
+                shape->line[i].numpoints=k+1; 
+            } else { 
+                shape->line[i].numpoints=k; 
+            }
         }
     }
     else if(shape->type == MS_SHAPE_POLYGON) {



More information about the mapserver-commits mailing list