X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/67ef83eb032b3fa056dbb09671c757dfc6e70496..bf9ce2abdf465110ca83469c1b336b056ae8ec72:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 071ee21039..206f09a255 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -1939,15 +1939,22 @@ void wxBoxSizer::RecalcSizes() // adjust the size in the major direction using the proportion wxCoord majorSize = GetSizeInMajorDir(sizeThis); - const int propItem = item->GetProportion(); - if ( propItem ) + + // if there is not enough space, don't try to distribute negative space + // among the children, this would result in overlapping windows which + // we don't want + if ( delta > 0 ) { - const int deltaItem = (delta * propItem) / totalProportion; + const int propItem = item->GetProportion(); + if ( propItem ) + { + const int deltaItem = (delta * propItem) / totalProportion; - majorSize += deltaItem; + majorSize += deltaItem; - delta -= deltaItem; - totalProportion -= propItem; + delta -= deltaItem; + totalProportion -= propItem; + } }