]> git.saurik.com Git - wxWidgets.git/blobdiff - src/dfb/overlay.cpp
added a tiny script to build both ANSI and Unicode debian packages
[wxWidgets.git] / src / dfb / overlay.cpp
index 740b3c169b2295b1deb9a0e95f119278c1794c54..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,13 +73,15 @@ 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.
     // Setting m_shouldFlip is done to avoid flipping and drawing of overlays
     // in ~wxWindowDC (we do it EndDrawing).
-    dc->Init(m_surface);
+    dc->DFBInit(m_surface);
     dc->SetDeviceOrigin(-origin.x, -origin.y);
     dc->m_shouldFlip = false;