[mapserver-commits] r13222 - sandbox/tb-labels

svn at osgeo.org svn at osgeo.org
Fri Mar 9 06:44:48 EST 2012


Author: tbonfort
Date: 2012-03-09 03:44:48 -0800 (Fri, 09 Mar 2012)
New Revision: 13222

Modified:
   sandbox/tb-labels/mapdraw.c
Log:
reorder msComputeBounds() and msTranformShape() operations


Modified: sandbox/tb-labels/mapdraw.c
===================================================================
--- sandbox/tb-labels/mapdraw.c	2012-03-09 11:38:30 UTC (rev 13221)
+++ sandbox/tb-labels/mapdraw.c	2012-03-09 11:44:48 UTC (rev 13222)
@@ -1604,6 +1604,7 @@
    } else {
       msOffsetShapeRelativeTo(shape, layer);
    }
+   msComputeBounds(shape);
    
    /* annotation layers can only have one layer, don't treat the multi layer case */
    labelObj *label = layer->class[c]->labels[0]; /* for brevity */
@@ -1617,7 +1618,6 @@
             msClipPolylineRect(shape, cliprect);
             if (shape->numlines == 0) return (MS_SUCCESS);
          }
-         msComputeBounds(shape);
 
 
          if (label->anglemode == MS_FOLLOW) { /* bug #1620 implementation */
@@ -1796,7 +1796,7 @@
    int *regularLines = NULL;
    double** angles = NULL, **lengths = NULL;
    int ret = MS_SUCCESS;
-   int numpaths = 1, numpoints = 1, numRegularLines = 0, i, j, s, l;
+   int numpaths = 1, numpoints = 1, numRegularLines = 0, i, j, s, l = 0;
    int bClipShape = MS_FALSE, bNeedUnclippedShape = MS_FALSE, bHasGeomTransform = MS_FALSE;
    shapeObj *unclipped_shape = NULL;
 
@@ -1840,6 +1840,8 @@
    } else {
       msOffsetShapeRelativeTo(shape, layer);
    }
+   msComputeBounds(shape);
+   
 
    if (bNeedUnclippedShape) {
       unclipped_shape = (shapeObj *) msSmallMalloc(sizeof (shapeObj));
@@ -1893,12 +1895,6 @@
          goto line_cleanup;
       }
    }
-   msComputeBounds(shape);
-   
-   if (bNeedUnclippedShape) {
-      msTransformShape(unclipped_shape, map->extent, map->cellsize, image);
-      msComputeBounds(unclipped_shape);
-   }
 
    /* RFC48: loop through the styles, and pass off to the type-specific
    function if the style has an appropriate type */
@@ -1910,7 +1906,7 @@
             msDrawLineSymbol(&map->symbolset, image, shape, layer->class[c]->styles[s], layer->scalefactor);
       }
    }
-
+   
    for (l = 0; l < layer->class[c]->numlabels; l++) {
       labelObj *label = layer->class[c]->labels[l];
       minfeaturesize = label->minfeaturesize * image->resolutionfactor;
@@ -2066,6 +2062,7 @@
    } else {
       msOffsetShapeRelativeTo(shape, layer);
    }
+   msComputeBounds(shape);
 
    if (bNeedUnclippedShape) {
       unclipped_shape = (shapeObj *) msSmallMalloc(sizeof (shapeObj));
@@ -2116,12 +2113,6 @@
          goto poly_cleanup;
       }
    }
-   msComputeBounds(shape);
-   
-   if (bNeedUnclippedShape) {
-      msTransformShape(unclipped_shape, map->extent, map->cellsize, image);
-      msComputeBounds(unclipped_shape);
-   }
 
    for (s = 0; s < layer->class[c]->numstyles; s++) {
       if (msScaleInBounds(map->scaledenom, layer->class[c]->styles[s]->minscaledenom, layer->class[c]->styles[s]->maxscaledenom)) {



More information about the mapserver-commits mailing list