X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..03d51a2d4095e3a2da174f8d6963c4802e636e95:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 37c790a4bd..7123f19c6a 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -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; }