[mapserver-commits] r12898 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Wed Dec 14 10:54:36 EST 2011
Author: tbonfort
Date: 2011-12-14 07:54:33 -0800 (Wed, 14 Dec 2011)
New Revision: 12898
Modified:
trunk/mapserver/maplabel.c
Log:
fix hard line wrapping for short strings
Modified: trunk/mapserver/maplabel.c
===================================================================
--- trunk/mapserver/maplabel.c 2011-12-14 09:10:32 UTC (rev 12897)
+++ trunk/mapserver/maplabel.c 2011-12-14 15:54:33 UTC (rev 12898)
@@ -134,7 +134,7 @@
int numglyphs,numlines;
maxlength = -maxlength; /* use a positive value*/
numglyphs = msGetNumGlyphs(text);
- numlines = numglyphs / maxlength; /*count total number of lines needed
+ numlines = (numglyphs-1) / maxlength + 1; /*count total number of lines needed
after splitting*/
if(numlines>1) {
char *newtext = msSmallMalloc(strlen(text)+numlines+1);
More information about the mapserver-commits
mailing list