fixed bug 418496 (wxDC::SetClippingRegion doesn't clear the previous clipping region)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10476 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2001-06-09 17:40:44 +00:00
parent 638bc56cf9
commit 40a8907605

View 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)