X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e6feb95a79834836e88143b15d9f424ebe79621..1971d23c57b3c582f32d05704914ad902ec76fa5:/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; }