From: Vadim Zeitlin Date: Sun, 11 Jul 2010 10:43:53 +0000 (+0000) Subject: Don't set negative size when using constraints for layout. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7e843c0e2bc193f4e76c6e428e795fe7786f02f8 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 --- diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index ac1fbb2f40..1c256cbdb7 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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 {