[mapserver-commits] r7946 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Oct 3 12:26:01 EDT 2008


Author: tbonfort
Date: 2008-10-03 12:26:00 -0400 (Fri, 03 Oct 2008)
New Revision: 7946

Modified:
   trunk/mapserver/mapdraw.c
Log:
don't draw label background if we're using angle follow. (#2726)

fix a bug that could happen when using a background color and force true and position auto



Modified: trunk/mapserver/mapdraw.c
===================================================================
--- trunk/mapserver/mapdraw.c	2008-10-03 15:42:20 UTC (rev 7945)
+++ trunk/mapserver/mapdraw.c	2008-10-03 16:26:00 UTC (rev 7946)
@@ -2218,8 +2218,18 @@
 
               } /* next position */
 
-              if(labelPtr->force) cachePtr->status = MS_TRUE; /* draw in spite of collisions based on last position, need a *best* position */
+              if(labelPtr->force) {
 
+                  /*billboard wasn't initialized if no non-coliding position was found*/
+                  if(!cachePtr->status && MS_VALID_COLOR(labelPtr->backgroundcolor))
+                      get_metrics_line(&(cachePtr->point), positions[npositions-1], r,
+                              (marker_offset_x + labelPtr->offsetx),
+                              (marker_offset_y + labelPtr->offsety),
+                              labelPtr->angle, 1, billboard.line);
+
+                  cachePtr->status = MS_TRUE; /* draw in spite of collisions based on last position, need a *best* position */
+              }
+
             } else { /* explicit position */
 
               cachePtr->status = MS_TRUE; /* assume label *can* be drawn */
@@ -2254,7 +2264,8 @@
               msDrawMarkerSymbol(&map->symbolset, image, &(cachePtr->point), &(cachePtr->styles[i]), layerPtr->scalefactor);
           }
 
-          if(MS_VALID_COLOR(labelPtr->backgroundcolor)) {
+          /*draw the background, only if we're not using FOLLOW labels*/
+          if(!cachePtr->labelpath && MS_VALID_COLOR(labelPtr->backgroundcolor)) {
             styleObj style;
 
             initStyle(&style);                    



More information about the mapserver-commits mailing list