]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed bug 418496 (wxDC::SetClippingRegion doesn't clear the previous clipping region)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 9 Jun 2001 17:40:44 +0000 (17:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 9 Jun 2001 17:40:44 +0000 (17:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10476 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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)