]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dc.cpp
add #error for platforms with weird sizeof(wchar_t)
[wxWidgets.git] / src / msw / dc.cpp
index 2ffb9264179c7d0dddedb239ece36638b55f24af..2a79ff7f852b3f7dcdb7377773630e8c9bc8743a 100644 (file)
@@ -278,9 +278,22 @@ void wxDC::SelectOldObjects(WXHDC dc)
 void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
 {
     m_clipping = TRUE;
-    IntersectClipRect(GetHdc(), XLOG2DEV(cx), YLOG2DEV(cy),
+
+    HRGN hrgn = ::CreateRectRgn(XLOG2DEV(cx), YLOG2DEV(cy),
                                 XLOG2DEV(cx + cw), YLOG2DEV(cy + ch));
-    DO_SET_CLIPPING_BOX()
+    if ( !hrgn )
+    {
+        wxLogLastError(_T("CreateRectRgn"));
+    }
+    else
+    {
+        if ( ::SelectClipRgn(GetHdc(), hrgn) == ERROR )
+        {
+            wxLogLastError(_T("SelectClipRgn"));
+        }
+
+        DO_SET_CLIPPING_BOX()
+    }
 }
 
 void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)