X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8898456df4728afe7d100011e0e23b0ffb9a6341..d68d85908b4f6073ae1c100abe3d9469fcd451d9:/src/common/image.cpp diff --git a/src/common/image.cpp b/src/common/image.cpp index af8111c5c7..64f367c521 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -19,6 +19,8 @@ #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/app.h" + #include "wx/hash.h" + #include "wx/utils.h" #endif #include "wx/image.h" @@ -28,12 +30,10 @@ #include "wx/wfstream.h" #include "wx/intl.h" #include "wx/module.h" -#include "wx/hash.h" -#include "wx/utils.h" #include "wx/math.h" #if wxUSE_XPM -#include "wx/xpmdecod.h" + #include "wx/xpmdecod.h" #endif // For memcpy @@ -708,6 +708,10 @@ wxImage wxImage::Size( const wxSize& size, const wxPoint& pos, wxRect subRect(pos.x, pos.y, width, height); wxRect finalRect(0, 0, size.GetWidth(), size.GetHeight()); + if (pos.x < 0) + finalRect.width -= pos.x; + if (pos.y < 0) + finalRect.height -= pos.y; subRect.Intersect(finalRect);