pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] rev 2243 - branches/pingus_0_6/src


From: address@hidden
Subject: [Pingus-CVS] rev 2243 - branches/pingus_0_6/src
Date: Sat, 10 Apr 2004 21:05:55 +0200

Author: torangan
Date: 2004-04-10 21:05:55 +0200 (Sat, 10 Apr 2004)
New Revision: 2243

Modified:
   branches/pingus_0_6/src/string_format.cxx
Log:
check the last word for wrapping problems along with the rest


Modified: branches/pingus_0_6/src/string_format.cxx
===================================================================
--- branches/pingus_0_6/src/string_format.cxx   2004-04-10 18:23:55 UTC (rev 
2242)
+++ branches/pingus_0_6/src/string_format.cxx   2004-04-10 19:05:55 UTC (rev 
2243)
@@ -69,15 +69,17 @@
     {
       if (font->get_text_width(text.substr(start_pos, pos - start_pos)) > 
length)
         {
-         text[previous_space] = '\n';
-         start_pos = previous_space + 1;
-       }
+          text[previous_space] = '\n';
+          start_pos = previous_space + 1;
+          previous_space = pos;
+        }
       else if (font->get_text_width(text.substr(start_pos, text.length())) <= 
length)
         break;
-
-      previous_space = pos;
     }
 
+       if (font->get_text_width(text.substr(start_pos, text.length() - 
start_pos)) > length)
+               text[text.rfind(' ')] = '\n';
+
   return text;
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]