[mapserver-commits] r8988 - sandbox/graphics

svn at osgeo.org svn at osgeo.org
Fri May 1 14:30:10 EDT 2009


Author: tbonfort
Date: 2009-05-01 14:30:10 -0400 (Fri, 01 May 2009)
New Revision: 8988

Modified:
   sandbox/graphics/maprendering.c
Log:
bug in polyline marker code


Modified: sandbox/graphics/maprendering.c
===================================================================
--- sandbox/graphics/maprendering.c	2009-05-01 18:19:13 UTC (rev 8987)
+++ sandbox/graphics/maprendering.c	2009-05-01 18:30:10 UTC (rev 8988)
@@ -243,7 +243,6 @@
     pointObj point;
     double original_rotation = style->rotation;
     double symbol_width = MS_MAX(1,symbol->sizex*style->scale);
-    double symbol_height = MS_MAX(1,symbol->sizey*style->scale);
     for(i=0; i<p->numlines; i++)
     {
         int in;
@@ -251,7 +250,7 @@
         double current_length = 1+symbol_width/2.0; // initial padding for each line
         for(j=1;j<p->line[i].numpoints;j++)
         {
-            double rx,ry,theta,angle;
+            double rx,ry,theta;
             length = sqrt((pow((p->line[i].point[j].x - p->line[i].point[j-1].x),2) + pow((p->line[i].point[j].y - p->line[i].point[j-1].y),2)));
             if(length==0)continue;
             rx = (p->line[i].point[j].x - p->line[i].point[j-1].x)/length;
@@ -286,13 +285,14 @@
                 current_length += symbol_width + spacing;
                 in = 1;
             }
+
+            if (in)
+            {
+                current_length -= length + symbol_width/2.0;
+            }
+            else current_length -= length;
         }
 
-        if (in)
-        {
-            current_length -= length + symbol_width/2.0;
-        }
-        else current_length -= length;
     }
 }
 



More information about the mapserver-commits mailing list