Skip to content

Commit

Permalink
Fix position of labelpoly on offsetted labels (#5326)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed Sep 20, 2016
1 parent fa4e319 commit cd70b0f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mapdraw.c
Expand Up @@ -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); \
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit cd70b0f

Please sign in to comment.