Permalink
Browse files

Fix position of labelpoly on offsetted labels (#5326)

  • Loading branch information...
1 parent fa4e319 commit cd70b0f4c6bd4b76736333bd02aa7d179f0619b5 @tbonfort tbonfort committed Sep 20, 2016
Showing with 4 additions and 4 deletions.
  1. +4 −4 mapdraw.c
View
@@ -2386,8 +2386,8 @@ int msDrawOffsettedLabels(imageObj *image, mapObj *map, int priority)
#define otest(ox,oy) if((x0+(ox)) >= labelcache->gutter &&\
(y0+(oy)) >= labelcache->gutter &&\
- (x0+(ox)) < image->width + labelcache->gutter &&\
- (y0+(oy)) < image->height + labelcache->gutter) {\
+ (x0+(ox)) < image->width - labelcache->gutter &&\
+ (y0+(oy)) < image->height - labelcache->gutter) {\
scratch_line.point = scratch_points;\
scratch.poly = &scratch_line; \
offsetAndTest(map,cachePtr,(ox),(oy),priority,l,&scratch); \
@@ -2952,15 +2952,15 @@ int msDrawLabelCache(mapObj *map, imageObj *image)
textSymbolPtr->rotation, textSymbolPtr->label->buffer * textSymbolPtr->scalefactor,
&metrics_bounds);
if(need_labelpoly) get_metrics(&(cachePtr->point), MS_CC, textSymbolPtr->textpath,
- marker_offset_x + label_offset_x, marker_offset_y + label_offset_y,
+ label_offset_x, label_offset_y,
textSymbolPtr->rotation, 1, &labelpoly_bounds);
}
} else { /* explicit position */
if(textSymbolPtr->label->position == MS_CC) { /* don't need the marker_offset */
metrics_bounds.poly = &metrics_line;
textSymbolPtr->annopoint = get_metrics(&(cachePtr->point), MS_CC, textSymbolPtr->textpath, label_offset_x, label_offset_y,
textSymbolPtr->rotation, textSymbolPtr->label->buffer * textSymbolPtr->scalefactor, &metrics_bounds);
- if(need_labelpoly) get_metrics(&(cachePtr->point), textSymbolPtr->label->position, textSymbolPtr->textpath,
+ if(need_labelpoly) get_metrics(&(cachePtr->point), MS_CC, textSymbolPtr->textpath,
label_offset_x, label_offset_y, textSymbolPtr->rotation, 1, &labelpoly_bounds);
} else {
metrics_bounds.poly = &metrics_line;

0 comments on commit cd70b0f

Please sign in to comment.