Skip to content

Commit cd70b0f

Browse files
committed
Fix position of labelpoly on offsetted labels (#5326)
1 parent fa4e319 commit cd70b0f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mapdraw.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -2386,8 +2386,8 @@ int msDrawOffsettedLabels(imageObj *image, mapObj *map, int priority)
23862386

23872387
#define otest(ox,oy) if((x0+(ox)) >= labelcache->gutter &&\
23882388
(y0+(oy)) >= labelcache->gutter &&\
2389-
(x0+(ox)) < image->width + labelcache->gutter &&\
2390-
(y0+(oy)) < image->height + labelcache->gutter) {\
2389+
(x0+(ox)) < image->width - labelcache->gutter &&\
2390+
(y0+(oy)) < image->height - labelcache->gutter) {\
23912391
scratch_line.point = scratch_points;\
23922392
scratch.poly = &scratch_line; \
23932393
offsetAndTest(map,cachePtr,(ox),(oy),priority,l,&scratch); \
@@ -2952,15 +2952,15 @@ int msDrawLabelCache(mapObj *map, imageObj *image)
29522952
textSymbolPtr->rotation, textSymbolPtr->label->buffer * textSymbolPtr->scalefactor,
29532953
&metrics_bounds);
29542954
if(need_labelpoly) get_metrics(&(cachePtr->point), MS_CC, textSymbolPtr->textpath,
2955-
marker_offset_x + label_offset_x, marker_offset_y + label_offset_y,
2955+
label_offset_x, label_offset_y,
29562956
textSymbolPtr->rotation, 1, &labelpoly_bounds);
29572957
}
29582958
} else { /* explicit position */
29592959
if(textSymbolPtr->label->position == MS_CC) { /* don't need the marker_offset */
29602960
metrics_bounds.poly = &metrics_line;
29612961
textSymbolPtr->annopoint = get_metrics(&(cachePtr->point), MS_CC, textSymbolPtr->textpath, label_offset_x, label_offset_y,
29622962
textSymbolPtr->rotation, textSymbolPtr->label->buffer * textSymbolPtr->scalefactor, &metrics_bounds);
2963-
if(need_labelpoly) get_metrics(&(cachePtr->point), textSymbolPtr->label->position, textSymbolPtr->textpath,
2963+
if(need_labelpoly) get_metrics(&(cachePtr->point), MS_CC, textSymbolPtr->textpath,
29642964
label_offset_x, label_offset_y, textSymbolPtr->rotation, 1, &labelpoly_bounds);
29652965
} else {
29662966
metrics_bounds.poly = &metrics_line;

0 commit comments

Comments
 (0)