X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3211838bf578eb8ada5a608b66626a6bde6846a..87df17a11b0017d31c09f767bd921abb27193bee:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index edd4fe4fa5..faa71428b5 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -40,6 +40,7 @@ #include "wx/icon.h" #endif +#include "wx/settings.h" #include "wx/dcprint.h" #include @@ -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"));