Don't set negative size when using constraints for layout.

Passing negative size to GTK+ results in error messages and in the future
wxWindow::SetSize() itself might assert if passed negative size so just avoid
setting it in the first place even if there is not enough space for
everything.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2010-07-11 10:43:53 +00:00
parent b35549525f
commit 7e843c0e2b

View File

@ -2291,7 +2291,9 @@ void wxWindowBase::SetConstraintSizes(bool recurse)
if ( (constr->width.GetRelationship() != wxAsIs ) ||
(constr->height.GetRelationship() != wxAsIs) )
{
SetSize(x, y, w, h);
// We really shouldn't set negative sizes for the windows so make
// them at least of 1*1 size
SetSize(x, y, w > 0 ? w : 1, h > 0 ? h : 1);
}
else
{