]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dc.cpp
corrected use of Print Manager Session APIs for Carbon targets
[wxWidgets.git] / src / msw / dc.cpp
index edd4fe4fa5679f7236fcb61f7eb32c4504bcd8d3..faa71428b5dd780989f636a1da9b0bcdfca2c505 100644 (file)
@@ -40,6 +40,7 @@
     #include "wx/icon.h"
 #endif
 
+#include "wx/settings.h"
 #include "wx/dcprint.h"
 
 #include <string.h>
@@ -275,12 +276,16 @@ void wxDC::SelectOldObjects(WXHDC dc)
     m_clipY2 = (wxCoord) YDEV2LOG(rect.bottom); \
 }
 
-void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
+void wxDC::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
 {
     m_clipping = TRUE;
 
-    HRGN hrgn = ::CreateRectRgn(XLOG2DEV(cx), YLOG2DEV(cy),
-                                XLOG2DEV(cx + cw), YLOG2DEV(cy + ch));
+    // the region coords are always the device ones, so do the translation
+    // manually
+    HRGN hrgn = ::CreateRectRgn(LogicalToDeviceX(x),
+                                LogicalToDeviceY(y),
+                                LogicalToDeviceX(x + w),
+                                LogicalToDeviceY(y + h));
     if ( !hrgn )
     {
         wxLogLastError(_T("CreateRectRgn"));