X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ca8d899fcb677bad4ed7df5c65887b725a092482..8168167976dc3cc5f5223a21e1a62ba91a4f77b3:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 6c536703f1..a691f6431c 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -27,6 +27,7 @@ #include "wx/settings.h" #include "wx/button.h" #include "wx/statbox.h" + #include "wx/toplevel.h" #endif // WX_PRECOMP #include "wx/listimpl.cpp" @@ -353,6 +354,11 @@ void wxSizerItem::SetDimension( const wxPoint& pos_, const wxSize& size_ ) size.y -= m_border; } + if (size.x < 0) + size.x = 0; + if (size.y < 0) + size.y = 0; + m_rect = wxRect(pos, size); switch ( m_kind ) @@ -1695,6 +1701,16 @@ void wxBoxSizer::RecalcSizes() // wxALIGN_CENTER should be used in new code child_pos.y += (m_size.y - size.y) / 2; + if ( m_containingWindow ) + { + child_pos.x = m_containingWindow->AdjustForLayoutDirection + ( + child_pos.x, + width, + m_size.x + ); + } + item->SetDimension( child_pos, child_size ); pt.x += width;