X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c16db850cd522e862902c6614295dd449b3b0856..1663c65500c557d53e94493b7cf59331852c064d:/src/dfb/overlay.cpp?ds=sidebyside diff --git a/src/dfb/overlay.cpp b/src/dfb/overlay.cpp index 64ae7eff53..6b7f4b2b30 100644 --- a/src/dfb/overlay.cpp +++ b/src/dfb/overlay.cpp @@ -23,6 +23,11 @@ #pragma hdrstop #endif +#ifndef WX_PRECOMP + #include "wx/window.h" + #include "wx/dcclient.h" +#endif + #include "wx/private/overlay.h" #include "wx/dfb/private.h" @@ -57,7 +62,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 +78,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.