]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/image.cpp
Include wx/dialog.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / common / image.cpp
index 9cac98dcbdd9c020231704bbfba3460631d98500..64f367c5216066cc9f3e6f1aa1420ce3c272b905 100644 (file)
     #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);