Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label frame offset with leader line #5326

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions mapdraw.c
Expand Up @@ -2269,7 +2269,7 @@ void offsetAndTest(mapObj *map, labelCacheMemberObj *cachePtr, double ox, double
}
}
for(j=0; j<ts->label->numstyles; j++) {
if(ts->label->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOINT) {
if(ts->label->styles[j]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOINT) {
scratch->poly = scratch_line;
offset_label_bounds(ts->style_bounds[j], scratch, ox, oy);
status = msTestLabelCacheCollisions(map, cachePtr, scratch, priority, label_idx);
Expand Down Expand Up @@ -2313,8 +2313,8 @@ void offsetAndTest(mapObj *map, labelCacheMemberObj *cachePtr, double ox, double
}
if(ts->style_bounds) {
for(j=0; j<ts->label->numstyles; j++) {
if(ts->label->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOINT ||
ts->label->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOLY) {
if(ts->label->styles[j]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOINT ||
ts->label->styles[j]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOLY) {
offset_label_bounds(ts->style_bounds[j], ts->style_bounds[j], ox, oy);
}
}
Expand Down 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 @@ -2511,7 +2511,7 @@ int msDrawOffsettedLabels(imageObj *image, mapObj *map, int priority)
/* here's where we draw the label styles */
for(i=0; i<ts->label->numstyles; i++) {
if(ts->label->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOINT) {
retval = msDrawMarkerSymbol(map, image, &(cachePtr->point), ts->label->styles[i], layerPtr->scalefactor);
retval = msDrawMarkerSymbol(map, image, &(labelLeader.line->point[1]), ts->label->styles[i], layerPtr->scalefactor);
if(UNLIKELY(retval == MS_FAILURE)) {
goto offset_cleanup;
}
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