#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
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);