X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ca6a5f04692678cd2d9f3ea0843fc3f5a0b254f..300aaa8f77daee5cd740c8c4cce63f40c6bfae4b:/src/common/sizer.cpp?ds=sidebyside diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 0802fea039..a412637448 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -897,28 +897,22 @@ wxSize wxBoxSizer::CalcMin() { wxSizerItem *item = (wxSizerItem*) node->Data(); - int weight = 1; - if (item->GetOption()) - weight = item->GetOption(); - + m_stretchable += item->GetOption(); + wxSize size( item->CalcMin() ); if (m_orient == wxHORIZONTAL) { - m_minWidth += (size.x * weight); + m_minWidth += size.x; m_minHeight = wxMax( m_minHeight, size.y ); } else { - m_minHeight += (size.y * weight); + m_minHeight += size.y; m_minWidth = wxMax( m_minWidth, size.x ); } - if (item->GetOption()) - { - m_stretchable += weight; - } - else + if (item->GetOption() == 0) { if (m_orient == wxVERTICAL) { @@ -926,7 +920,7 @@ wxSize wxBoxSizer::CalcMin() m_fixedWidth = wxMax( m_fixedWidth, size.x ); } else - { + { m_fixedWidth += size.x; m_fixedHeight = wxMax( m_fixedHeight, size.y ); }