From afb49a224b7b693368c4fba9393bd69a140a4300 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 29 Jan 2014 22:25:51 +0000 Subject: [PATCH] Fix wxClientDC::Clear() for scrolled windows in wxMSW. Take the DC origin into account when clearing a window DC and not only a memory one. Closes #2048. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75737 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dc.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index fd05a3de1a..8bff54a175 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -694,11 +694,13 @@ void wxMSWDCImpl::Clear() if (!m_selectedBitmap.IsOk()) return; - rect.left = -m_deviceOriginX; rect.top = -m_deviceOriginY; - rect.right = m_selectedBitmap.GetWidth()-m_deviceOriginX; - rect.bottom = m_selectedBitmap.GetHeight()-m_deviceOriginY; + rect.left = rect.top = 0; + rect.right = m_selectedBitmap.GetWidth(); + rect.bottom = m_selectedBitmap.GetHeight(); } + ::OffsetRect(&rect, -m_deviceOriginX, -m_deviceOriginY); + #ifndef __WXWINCE__ (void) ::SetMapMode(GetHdc(), MM_TEXT); #endif