]> git.saurik.com Git - wxWidgets.git/commitdiff
Only call GetBestSize if one or both of the minsize components are unset.
authorRobin Dunn <robin@alldunn.com>
Tue, 8 Jun 2004 16:33:47 +0000 (16:33 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 8 Jun 2004 16:33:47 +0000 (16:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/sizer.cpp

index 37c790a4bddc5cec9cb41594b14c70db6f073257..7123f19c6a62a97926ef7082a6ea123758389bc1 100644 (file)
@@ -199,9 +199,12 @@ wxSize wxSizerItem::CalcMin()
             // should use the current minimal size.  If there is a MinSize,
             // use it, otherwise use the BestSize.
             wxSize min  = m_window->GetMinSize();
-            wxSize best = m_window->GetBestSize();
-            if (min.x == -1) min.x =  best.x;
-            if (min.y == -1) min.y =  best.y;
+            if (min.x == -1 || min.y == -1)
+            {
+                wxSize best = m_window->GetBestSize();
+                if (min.x == -1) min.x =  best.x;
+                if (min.y == -1) min.y =  best.y;
+            }
             m_minSize = min;
         }