Permalink
Browse files

Fix offset calculation for line legend icons (#2636)

  • Loading branch information...
1 parent 5ce74bf commit 1273583bf13732d1cd329318566a5ec24b19803c @szekerest szekerest committed Jan 4, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 maplegend.c
View
@@ -208,7 +208,11 @@ int msDrawLegendIcon(mapObj *map, layerObj *lp, classObj *theclass,
offset = 1;
/* To set the offset, we only check the size/width parameter of the first style */
if (theclass->numstyles > 0) {
- offset = (theclass->styles[0]->size != -1) ? theclass->styles[0]->size/2 : theclass->styles[0]->width/2;
+ if (theclass->styles[0]->symbol > 0 && theclass->styles[0]->symbol < map->symbolset.numsymbols &&
+ map->symbolset.symbol[theclass->styles[0]->symbol]->type != MS_SYMBOL_SIMPLE)
+ offset = theclass->styles[0]->size/2;
+ else
+ offset = theclass->styles[0]->width/2;
}
zigzag.line = (lineObj *)msSmallMalloc(sizeof(lineObj));
zigzag.numlines = 1;

0 comments on commit 1273583

Please sign in to comment.