]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxOverlay to handle wxWindowDC/wxClientDC in the same way wxMac does
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 8 Nov 2006 12:17:56 +0000 (12:17 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 8 Nov 2006 12:17:56 +0000 (12:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/dfb/overlay.cpp

index 64ae7eff539575eb5d5283ac12dd1ee49a047288..56f3dfb5f15c9d9ed3d200ef6684222271dcaf9f 100644 (file)
@@ -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.