From 4ca64d4137439844a5e6c95b4da16f32cf7840ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 8 Nov 2006 12:17:56 +0000 Subject: [PATCH] fixed wxOverlay to handle wxWindowDC/wxClientDC in the same way wxMac does git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/dfb/overlay.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dfb/overlay.cpp b/src/dfb/overlay.cpp index 64ae7eff53..56f3dfb5f1 100644 --- a/src/dfb/overlay.cpp +++ b/src/dfb/overlay.cpp @@ -57,7 +57,8 @@ void wxOverlayImpl::Init(wxWindowDC *dc, int x, int y, int width, int height) m_window = dc->GetWindow(); m_rect = wxRect(x, y, width, height); - m_rect.Offset(m_window->GetClientAreaOrigin()); + if ( wxDynamicCast(dc, wxClientDC) ) + m_rect.Offset(m_window->GetClientAreaOrigin()); // FIXME: create surface with transparency or key color (?) m_surface = @@ -72,7 +73,9 @@ void wxOverlayImpl::Init(wxWindowDC *dc, int x, int y, int width, int height) void wxOverlayImpl::BeginDrawing(wxWindowDC *dc) { - wxPoint origin(m_rect.GetPosition() - m_window->GetClientAreaOrigin()); + wxPoint origin(m_rect.GetPosition()); + if ( wxDynamicCast(dc, wxClientDC) ) + origin -= m_window->GetClientAreaOrigin(); // drawing on overlay "hijacks" existing wxWindowDC rather then using // another DC, so we have to change the DC to draw on the overlay's surface. -- 2.45.2