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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user