mail[Wesnoth-commits] r43179 - /trunk/src/font.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by alinktomine on June 04, 2010 - 21:47:
Author: alink
Date: Fri Jun  4 21:47:41 2010
New Revision: 43179

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43179&view=rev
Log:
Remove last newline in floating label (useless and looks bad in tooltips)

Modified:
    trunk/src/font.cpp

Modified: trunk/src/font.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/font.cpp?rev=43179&r1=43178&r2=43179&view=diff
==============================================================================
--- trunk/src/font.cpp (original)
+++ trunk/src/font.cpp Fri Jun  4 21:47:41 2010
@@ -961,7 +961,14 @@
                text.set_font_size(font_size_);
                text.set_maximum_width(width_ < 0 ? clip_rect_.w : width_);
                text.set_maximum_height(clip_rect_.h);
-               text.set_text(text_, use_markup_);
+
+               //ignore last '\n'
+               if(!text_.empty() && *(text_.rbegin()) == '\n'){
+                       text.set_text(std::string(text_.begin(), 
text_.end()-1), use_markup_);
+               } else {
+                       text.set_text(text_, use_markup_);
+               }
+
                // Reset the maximum width, as we want the smallest bounding 
box.
                text.set_maximum_width(text.get_width());
                surface foreground = text.render();




Related Messages


Powered by MHonArc, Updated Fri Jun 04 22:20:09 2010