m_window = dc->GetWindow();
m_rect = wxRect(x, y, width, height);
m_window = dc->GetWindow();
m_rect = wxRect(x, y, width, height);
- 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).
// 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->SetDeviceOrigin(-origin.x, -origin.y);
dc->m_shouldFlip = false;
dc->SetDeviceOrigin(-origin.x, -origin.y);
dc->m_shouldFlip = false;