]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/image.cpp
removed wxIsLoggingEnabled() as it could create the log target as an unwanted side...
[wxWidgets.git] / src / common / image.cpp
index af8111c5c7d7ec4c78ad4062118cd86b01370ced..64f367c5216066cc9f3e6f1aa1420ce3c272b905 100644 (file)
@@ -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"
 #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);