[mapserver-commits] r13254 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Mar 14 11:47:33 EDT 2012


Author: tbonfort
Date: 2012-03-14 08:47:33 -0700 (Wed, 14 Mar 2012)
New Revision: 13254

Modified:
   trunk/mapserver/mapdraw.c
Log:
fix incorrect collision calculations for offset labels


Modified: trunk/mapserver/mapdraw.c
===================================================================
--- trunk/mapserver/mapdraw.c	2012-03-14 15:46:12 UTC (rev 13253)
+++ trunk/mapserver/mapdraw.c	2012-03-14 15:47:33 UTC (rev 13254)
@@ -2337,12 +2337,18 @@
       cachePtr->leaderbbox->maxy = cachePtr->leaderline->point[0].y;
       cachePtr->leaderbbox->miny = cachePtr->point.y;
    }
-   cachePtr->status = msTestLabelCacheCollisions(map, cachePtr, cachePtr->poly, cachePtr->labels[0].mindistance,0,0);
+   cachePtr->status = msTestLabelCacheCollisions(map, cachePtr, cachePtr->poly, cachePtr->labels[0].mindistance,priority,-label_idx);
    if(cachePtr->status) {
       int ll;
       for(ll=0;ll<cachePtr->numlabels;ll++) {
          cachePtr->labels[ll].annopoint.x += ox;
          cachePtr->labels[ll].annopoint.y += oy;
+         if(cachePtr->labels[ll].annopoly) {
+            for(i=0;i<5;i++) {
+               cachePtr->labels[ll].annopoly->line[0].point[i].x += ox;
+               cachePtr->labels[ll].annopoly->line[0].point[i].y += oy;
+            }
+         }
       }
    }
 }
@@ -2391,6 +2397,7 @@
 #define y0 (cachePtr->leaderline->point[0].y)
 #define gridstepsc (classPtr->leader.gridstep)
 
+
 #define otest(ox,oy) if((x0+(ox)) >= labelcache->gutter &&\
                   (y0+(oy)) >= labelcache->gutter &&\
                   (x0+(ox)) < image->width + labelcache->gutter &&\
@@ -2969,6 +2976,9 @@
                   labelPtr->annopoint = get_metrics_line(&(cachePtr->point), MS_CC, r,
                         marker_offset_x + label_offset_x, marker_offset_y + label_offset_y,
                         labelPtr->angle, label_buffer, &metrics_line);
+                  if(labelPtr->annopoly) get_metrics_line(&(cachePtr->point), MS_CC, r,
+                          marker_offset_x + label_offset_x, marker_offset_y + label_offset_y,
+                          labelPtr->angle, 1, labelPtr->annopoly->line);
                   fastComputeBounds(&metrics_poly);
                 }
               } else { /* explicit position */



More information about the mapserver-commits mailing list