Permalink
Browse files

Move #4577 fixes out of libmapserver

  • Loading branch information...
tbonfort committed Apr 18, 2013
1 parent a58d6bb commit 0fb99fce7fb63a267e17f7a2ecd5c85c5e455e3c
Showing with 7 additions and 10 deletions.
  1. +0 −8 mapdraw.c
  2. +3 −1 mapscript/php/mapscript_i.c
  3. +4 −1 mapscript/swiginc/rect.i
View
@@ -1970,14 +1970,6 @@ int msDrawShape(mapObj *map, layerObj *layer, shapeObj *shape, imageObj *image,
msDrawStartShape(map, layer, image, shape);
c = shape->classindex;
/* When creating a shape in mapscript and setting the shape.text directly, the
text rendering fails without this #4577. If annotext of the first label is
not null, msShapeGetAnnotation has already been called: do nothing */
if(layer->class[c]->numlabels > 0 && shape->text &&
(layer->class[c]->labels[0] && layer->class[c]->labels[0]->annotext==NULL)) {
msShapeGetAnnotation(layer, shape);
}
/* Before we do anything else, we will check for a rangeitem.
If its there, we need to change the style's color to map
the range to the shape */
@@ -1507,8 +1507,10 @@ int rectObj_draw(rectObj *self, mapObj *map, layerObj *layer,
msRectToPolygon(*self, &shape);
shape.classindex = classindex;
if (text)
if(text && layer->class[classindex]->numlabels > 0) {
shape.text = strdup(text);
msShapeGetAnnotation(layer,&shape);
}
msDrawShape(map, layer, &shape, img, -1, MS_DRAWMODE_FEATURES|MS_DRAWMODE_LABELS);
View
@@ -90,7 +90,10 @@
msInitShape(&shape);
msRectToPolygon(*self, &shape);
shape.classindex = classindex;
shape.text = strdup(text);
if(text && layer->class[classindex]->numlabels > 0) {
shape.text = strdup(text);
msShapeGetAnnotation(layer,&shape);
}
msDrawShape(map, layer, &shape, image, -1, MS_DRAWMODE_FEATURES|MS_DRAWMODE_LABELS);

1 comment on commit 0fb99fc

@aboudreault

This comment has been minimized.

Show comment
Hide comment
@aboudreault

aboudreault Apr 18, 2013

Member

Thanks Thomas!

Member

aboudreault commented on 0fb99fc Apr 18, 2013

Thanks Thomas!

Please sign in to comment.