X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/840bb342006648a99f89dc3088846d5a74c8fb13..87df17a11b0017d31c09f767bd921abb27193bee:/src/msw/dc.cpp?ds=sidebyside diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 2600103b1e..faa71428b5 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -276,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"));