diff --git a/clientgui/sg_CustomControls.cpp b/clientgui/sg_CustomControls.cpp index 356efb6968..93054d2e1a 100644 --- a/clientgui/sg_CustomControls.cpp +++ b/clientgui/sg_CustomControls.cpp @@ -180,8 +180,14 @@ void CTransparentHyperlinkCtrl::OnEraseBackground(wxEraseEvent& event) wxMemoryDC memDC(**m_pParentsBgBmp); wxSize sz = GetClientSize(); wxDC *dc = event.GetDC(); - wxCoord x, y; - GetPosition(&x, &y); + wxCoord x=0, y=0, xx, yy; + wxWindow* win = this; + do { + win->GetPosition(&xx, &yy); + x += xx; + y += yy; + win = win->GetParent(); + } while (!win->IsTopLevel()); dc->Blit(0, 0, sz.GetWidth(), sz.GetHeight(), &memDC, x, y, wxCOPY); } else { event.Skip(); @@ -365,8 +371,14 @@ void CTransparentCheckBox::OnEraseBackground(wxEraseEvent& event) wxMemoryDC memDC(**m_pParentsBgBmp); wxSize sz = GetClientSize(); wxDC *dc = event.GetDC(); - wxCoord x, y; - GetPosition(&x, &y); + wxCoord x=0, y=0, xx, yy; + wxWindow* win = this; + do { + win->GetPosition(&xx, &yy); + x += xx; + y += yy; + win = win->GetParent(); + } while (!win->IsTopLevel()); dc->Blit(0, 0, sz.GetWidth(), sz.GetHeight(), &memDC, x, y, wxCOPY); } else { event.Skip();