Permalink
Browse files

Fixed case when drawing legend shapes with style geomtransforms. (#5193)

  • Loading branch information...
sdlime committed Feb 4, 2016
1 parent 9a7c27a commit aee1c1f2da87833592bd8c1e2671fbd2004df064
Showing with 11 additions and 0 deletions.
  1. +9 −0 mapgeomtransform.c
  2. +2 −0 maplegend.c
@@ -180,6 +180,15 @@ int msDrawTransformedShape(mapObj *map, imageObj *image, shapeObj *shape, styleO

p.shape = shape; /* set a few parser globals (hence the lock) */
p.expr = &(style->_geomtransform);

if(p.expr->tokens == NULL) { /* this could happen if drawing originates from legend code (#5193) */
status = msTokenizeExpression(p.expr, NULL, NULL);
if(status != MS_SUCCESS) {
msSetError(MS_MISCERR, "Unable to tokenize expression.", "msDrawTransformedShape()");
return MS_FAILURE;
}
}

p.expr->curtoken = p.expr->tokens; /* reset */
p.type = MS_PARSE_TYPE_SHAPE;

@@ -123,6 +123,7 @@ int msDrawLegendIcon(mapObj *map, layerObj *lp, classObj *theclass,
box.numlines = 1;
box.line[0].point = box_point;
box.line[0].numpoints = 5;
box.type = MS_SHAPE_POLYGON;

box.line[0].point[0].x = dstX + polygon_contraction;
box.line[0].point[0].y = dstY + polygon_contraction;
@@ -198,6 +199,7 @@ int msDrawLegendIcon(mapObj *map, layerObj *lp, classObj *theclass,
zigzag.numlines = 1;
zigzag.line[0].point = zigzag_point;
zigzag.line[0].numpoints = 4;
zigzag.type = MS_SHAPE_LINE;

zigzag.line[0].point[0].x = dstX + offset;
zigzag.line[0].point[0].y = dstY + height - offset;

0 comments on commit aee1c1f

Please sign in to comment.