X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/89a94520ea3a77cd4b75a34c1007f850d49aa737..095b80e2b5120d4c476a834b2017c355fa9afef0:/src/common/sizer.cpp?ds=sidebyside 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; }