X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..a308135449c51cbf067c128c9b61354ca7f899c9:/src/common/gdicmn.cpp diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 9b17e4400b..239278c28e 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -122,8 +122,16 @@ wxRect& wxRect::Inflate(wxCoord dx, wxCoord dy) // check that we didn't make the rectangle invalid by accident (you almost // never want to have negative coords and never want negative size) - wxASSERT_MSG( x >= 0 && y >= 0 && width >= 0 && height >= 0, - _T("wxRect::Inflate() resulted in an invalid rectangle!") ); + if ( x < 0 ) + x = 0; + if ( y < 0 ) + y = 0; + + // what else can we do? + if ( width < 0 ) + width = 0; + if ( height < 0 ) + height = 0; return *this; }