[mapserver-commits] r12888 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Dec 13 04:59:04 EST 2011


Author: tbonfort
Date: 2011-12-13 01:59:04 -0800 (Tue, 13 Dec 2011)
New Revision: 12888

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapdraw.c
Log:
Fix LABELPNT geomtransform position for non-cached labels (#4121)


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-12-12 18:43:22 UTC (rev 12887)
+++ trunk/mapserver/HISTORY.TXT	2011-12-13 09:59:04 UTC (rev 12888)
@@ -14,6 +14,9 @@
 
 Current Version (SVN trunk, 6.1-dev, future 6.2): 
 -------------------------------------------------
+
+- Fix LABELPNT geomtransform position for non-cached labels (#4121)
+
 - Add RFC80 font fallback support (#4114)
 
 - Added POLAROFFSET style option for a different symbol transform (#4117)

Modified: trunk/mapserver/mapdraw.c
===================================================================
--- trunk/mapserver/mapdraw.c	2011-12-12 18:43:22 UTC (rev 12887)
+++ trunk/mapserver/mapdraw.c	2011-12-13 09:59:04 UTC (rev 12888)
@@ -2421,6 +2421,7 @@
   lineObj labelPolyLine;
   pointObj labelPolyPoints[5];
   int needLabelPoly=MS_TRUE;
+  int needLabelPoint=MS_TRUE;
 
   int label_offset_x, label_offset_y;
   double size;
@@ -2446,18 +2447,13 @@
 
   if(label->position != MS_XY) {
     pointObj p;
-    int needLabelPoint=MS_TRUE;
 
     if(label->numstyles > 0) {
       int i;
 
       for(i=0; i<label->numstyles; i++) {
         if(label->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOINT) {
-          if(needLabelPoint) {
-            p = get_metrics_line(&labelPnt, label->position, r, label_offset_x, label_offset_y, label->angle, 0, NULL);
-            needLabelPoint = MS_FALSE; /* don't re-compute */
-          } 
-          msDrawMarkerSymbol(&map->symbolset, image, &p, label->styles[i], scalefactor);
+          msDrawMarkerSymbol(&map->symbolset, image, &labelPnt, label->styles[i], scalefactor);
         } else if(label->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOLY) {
           if(needLabelPoly) {
             labelPoly.line = &labelPolyLine; /* setup the label polygon structure */
@@ -2622,7 +2618,7 @@
               return MS_FAILURE;
              
             /* adjust the baseline (see #1449) */
-            if(labelPtr->type == MS_TRUETYPE) {
+            if(1 || labelPtr->type == MS_TRUETYPE) {
               int nNewlines = msCountChars(cachePtr->text,'\n');
               if(!nNewlines) {
                 labelPtr->offsety += MS_NINT((((r.miny + r.maxy) + size) / 2.0)/scalefactor);



More information about the mapserver-commits mailing list