Permalink
Browse files

Legend icons do not reflect geometry transformations (#4642)

  • Loading branch information...
1 parent e1d8c83 commit 8763f91ac5de4c26a5c7d05859c8a1deae340ec3 @szekerest szekerest committed May 1, 2013
Showing with 12 additions and 3 deletions.
  1. +12 −3 maplegend.c
View
@@ -231,8 +231,13 @@ int msDrawLegendIcon(mapObj *map, layerObj *lp, classObj *theclass,
zigzag.line[0].point[3].x = dstX + width - offset;
zigzag.line[0].point[3].y = dstY + offset;
- for(i=0; i<theclass->numstyles; i++)
- msDrawLineSymbol(&map->symbolset, image_draw, &zigzag, theclass->styles[i], lp->scalefactor);
+ for(i=0; i<theclass->numstyles; i++) {
+ if (theclass->styles[i]->_geomtransform.type != MS_GEOMTRANSFORM_NONE)
+ msDrawTransformedShape(map, &map->symbolset, image_draw, &zigzag,
+ theclass->styles[i], lp->scalefactor);
+ else
+ msDrawLineSymbol(&map->symbolset, image_draw, &zigzag, theclass->styles[i], lp->scalefactor);
+ }
free(zigzag.line[0].point);
free(zigzag.line);
@@ -242,7 +247,11 @@ int msDrawLegendIcon(mapObj *map, layerObj *lp, classObj *theclass,
case MS_LAYER_CHART:
case MS_LAYER_POLYGON:
for(i=0; i<theclass->numstyles; i++)
- msDrawShadeSymbol(&map->symbolset, image_draw, &box, theclass->styles[i], lp->scalefactor);
+ if (theclass->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_NONE)
+ msDrawShadeSymbol(&map->symbolset, image_draw, &box, theclass->styles[i], lp->scalefactor);
+ else
+ msDrawTransformedShape(map, &map->symbolset, image_draw, &box,
+ theclass->styles[i], lp->scalefactor);
break;
default:
return MS_FAILURE;

0 comments on commit 8763f91

Please sign in to comment.