Skip to content

Commit

Permalink
Legend icons do not reflect geometry transformations (#4642)
Browse files Browse the repository at this point in the history
  • Loading branch information
szekerest committed May 1, 2013
1 parent e1d8c83 commit 8763f91
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions maplegend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 8763f91

Please sign in to comment.