MCPcopy Create free account
hub / github.com/MapServer/MapServer / labelInImage

Function labelInImage

maplabel.c:455–469  ·  view source on GitHub ↗

** Is a label completely in the image, reserving a gutter (in pixels) inside ** image for no labels (effectively making image larger. The gutter can be ** negative in cases where a label has a buffer around it. */

Source from the content-addressed store, hash-verified

453** negative in cases where a label has a buffer around it.
454*/
455static int labelInImage(int width, int height, shapeObj *lpoly, int gutter)
456{
457 int i,j;
458
459 for(i=0; i<lpoly->numlines; i++) {
460 for(j=1; j<lpoly->line[i].numpoints; j++) {
461 if(lpoly->line[i].point[j].x < gutter) return(MS_FALSE);
462 if(lpoly->line[i].point[j].x >= width-gutter) return(MS_FALSE);
463 if(lpoly->line[i].point[j].y < gutter) return(MS_FALSE);
464 if(lpoly->line[i].point[j].y >= height-gutter) return(MS_FALSE);
465 }
466 }
467
468 return(MS_TRUE);
469}
470
471/* msTestLabelCacheCollisions()
472**

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected