Permalink
Browse files

Recalculate scale factor in drawLegendIcon from mapscript (#5287)

  • Loading branch information...
szekerest committed May 29, 2016
1 parent f2b0310 commit 7121ac7c32642b9c1bf182ef66e2a6324c04ebbe
Showing with 8 additions and 1 deletion.
  1. +8 −1 mapscript/swiginc/class.i
@@ -176,7 +176,14 @@
return (char *) msNextKeyFromHashTable(&(self->metadata), lastkey);
}
int drawLegendIcon(mapObj *map, layerObj *layer, int width, int height, imageObj *dstImage, int dstX, int dstY) {
int drawLegendIcon(mapObj *map, layerObj *layer, int width, int height, imageObj *dstImage, int dstX, int dstY) {
if(layer->sizeunits != MS_PIXELS) {
map->cellsize = msAdjustExtent(&(map->extent), map->width, map->height);
layer->scalefactor = (msInchesPerUnit(layer->sizeunits,0)/msInchesPerUnit(map->units,0)) / map->cellsize;
}
else
layer->scalefactor = map->resolution/map->defresolution;
return msDrawLegendIcon(map, layer, self, width, height, dstImage, dstX, dstY, MS_TRUE, NULL);
}

0 comments on commit 7121ac7

Please sign in to comment.