Shapes will now draw the right background color when erased if the

canvas is not white.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12715 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-11-27 00:35:36 +00:00
parent fd008b87e3
commit 67d54b58cb
6 changed files with 62 additions and 69 deletions

View File

@@ -997,8 +997,9 @@ void wxShape::OnEraseContents(wxDC& dc)
if (m_pen)
penWidth = m_pen->GetWidth();
dc.SetPen(* g_oglWhiteBackgroundPen);
dc.SetBrush(* g_oglWhiteBackgroundBrush);
dc.SetPen(GetBackgroundPen());
dc.SetBrush(GetBackgroundBrush());
dc.DrawRectangle(WXROUND(topLeftX - penWidth), WXROUND(topLeftY - penWidth),
WXROUND(maxX + penWidth*2.0 + 4.0), WXROUND(maxY + penWidth*2.0 + 4.0));
}
@@ -3281,3 +3282,25 @@ void wxShape::Rotate(double WXUNUSED(x), double WXUNUSED(y), double theta)
}
}
wxPen wxShape::GetBackgroundPen()
{
if (GetCanvas())
{
wxColour c = GetCanvas()->GetBackgroundColour();
return wxPen(c, 1, wxSOLID);
}
return * g_oglWhiteBackgroundPen;
}
wxBrush wxShape::GetBackgroundBrush()
{
if (GetCanvas())
{
wxColour c = GetCanvas()->GetBackgroundColour();
return wxBrush(c, wxSOLID);
}
return * g_oglWhiteBackgroundBrush;
}