X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32d4c30a13f65b7c8cb66f813a0b8c606ad8480b..eaba6eba3a1ca393e6ecbafa601cc3b54e705901:/src/common/image.cpp diff --git a/src/common/image.cpp b/src/common/image.cpp index 9ce814f683..9e53e054f5 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -20,16 +20,15 @@ #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/filefn.h" #include "wx/wfstream.h" #include "wx/intl.h" #include "wx/module.h" -#include "wx/utils.h" #include "wx/math.h" #if wxUSE_XPM @@ -708,6 +707,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);