X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..75736a9c818f10e49b51506d967759fbecb4fa66:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index cbf684cdf3..7123f19c6a 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -7,7 +7,7 @@ // Created: // RCS-ID: $Id$ // Copyright: (c) Robin Dunn, Robert Roebling -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) @@ -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; }