mail[Wesnoth-commits] r28431 - /trunk/src/gui/widgets/control.cpp


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

Header


Content

Posted by koraq on August 10, 2008 - 16:58:
Author: mordante
Date: Sun Aug 10 15:51:53 2008
New Revision: 28431

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28431&view=rev
Log:
Add an extra test for the size whether or not to allow multiple lines 
(not too much tested yet).

Modified:
    trunk/src/gui/widgets/control.cpp

Modified: trunk/src/gui/widgets/control.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/control.cpp?rev=28431&r1=28430&r2=28431&view=diff
==============================================================================
--- trunk/src/gui/widgets/control.cpp (original)
+++ trunk/src/gui/widgets/control.cpp Sun Aug 10 15:51:53 2008
@@ -243,13 +243,17 @@
 
        // Try with the minimum wanted size.
        text.set_maximum_width(size.x);
-       text.set_maximum_height(size.y);
+       if(multiline_label_) {
+               text.set_maximum_height(size.y);
+       }
 
        // If doesn't fit try the maximum.
        if(text.is_truncated()) {
                const tpoint maximum_size(config_->max_width, 
config_->max_height);
                text.set_maximum_width(maximum_size.x ? maximum_size.x - 
border.x : -1);
-               text.set_maximum_height(maximum_size.y ? maximum_size.y - 
border.y : -1);
+               if(multiline_label_) {
+                       text.set_maximum_height(maximum_size.y ? 
maximum_size.y - border.y : -1);
+               }
        }
 
        size = text.get_size() + border;




Related Messages


Powered by MHonArc, Updated Sun Aug 10 17:21:55 2008