X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e8cfff879ef8f5fdf7323010c244cfb8cfcedc84..80a779275ae04443c568dca919adb26cf6f5002c:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 89778aa339..a691f6431c 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -25,7 +25,9 @@ #include "wx/math.h" #include "wx/utils.h" #include "wx/settings.h" + #include "wx/button.h" #include "wx/statbox.h" + #include "wx/toplevel.h" #endif // WX_PRECOMP #include "wx/listimpl.cpp" @@ -352,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 ) @@ -1694,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;