[mapserver-commits] r9512 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Oct 26 11:49:03 EDT 2009


Author: aboudreault
Date: 2009-10-26 11:49:03 -0400 (Mon, 26 Oct 2009)
New Revision: 9512

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapprimitive.c
Log:
Fixed labels centering when the label is longer than the line (#2867)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-10-25 04:08:47 UTC (rev 9511)
+++ trunk/mapserver/HISTORY.TXT	2009-10-26 15:49:03 UTC (rev 9512)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Fixed labels centering when the label is longer than the line (#2867)
+
 - Ensure Python MapScript building doesn't reorder the libraries, support the 
   'subprocess' module where available for setup.py, and default to using the 
   "super" swig invocation described in the Python MapScript README when 

Modified: trunk/mapserver/mapprimitive.c
===================================================================
--- trunk/mapserver/mapprimitive.c	2009-10-25 04:08:47 UTC (rev 9511)
+++ trunk/mapserver/mapprimitive.c	2009-10-26 15:49:03 UTC (rev 9512)
@@ -1742,14 +1742,20 @@
             segment_length = segment_lengths[i][j];
 
             /* determine how far along the segment we need to go */
-            t = 1 - (fwd_line_length - text_start_length) / segment_length;
+            if(text_start_length < 0.0)
+              t = text_start_length / segment_length;
+            else
+              t = 1 - (fwd_line_length - text_start_length) / segment_length;
         } else {
             j = final_j;
             inc = -1;
       
             /* length of the segment containing the starting point */
             segment_length = segment_lengths[i][j-1];
-            t = 1 - (rev_line_length - text_end_length) / segment_length;    
+            if(text_start_length < 0.0)
+              t = text_start_length / segment_length;
+            else
+              t = 1 - (rev_line_length - text_end_length) / segment_length;    
         }
     
         distance_along_segment = t * segment_length; /* starting point */



More information about the mapserver-commits mailing list