X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/051924b886f86eb2172232196f112860d1a39fb3..fdf565feca722eddb84168a95dbef329ba23d719:/src/common/image.cpp diff --git a/src/common/image.cpp b/src/common/image.cpp index 9cac98dcbd..64f367c521 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -14,25 +14,26 @@ #pragma hdrstop #endif -#include "wx/defs.h" - #if wxUSE_IMAGE +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/app.h" + #include "wx/hash.h" + #include "wx/utils.h" +#endif + #include "wx/image.h" #include "wx/bitmap.h" #include "wx/debug.h" -#include "wx/log.h" -#include "wx/app.h" #include "wx/filefn.h" #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 @@ -707,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);