Clear background with white brush by default in wxGCDC

This makes wxGCDC consistent with wxDC.

This commit is best viewed ignoring whitespace.
This commit is contained in:
Vadim Zeitlin
2019-10-01 01:28:42 +02:00
parent c8ca1df2cb
commit 1f8b73b0d8

View File

@@ -1287,9 +1287,8 @@ void wxGCDCImpl::Clear(void)
if ( m_backgroundBrush.IsTransparent() )
return;
if ( m_backgroundBrush.IsOk() )
{
m_graphicContext->SetBrush( m_backgroundBrush );
m_graphicContext->SetBrush( m_backgroundBrush.IsOk() ? m_backgroundBrush
: *wxWHITE_BRUSH );
wxPen p = *wxTRANSPARENT_PEN;
m_graphicContext->SetPen( p );
wxCompositionMode formerMode = m_graphicContext->GetCompositionMode();
@@ -1302,13 +1301,6 @@ void wxGCDCImpl::Clear(void)
m_graphicContext->SetCompositionMode(formerMode);
m_graphicContext->SetPen( m_pen );
m_graphicContext->SetBrush( m_brush );
}
else
{
double x, y, w, h;
m_graphicContext->GetClipBox(&x, &y, &w, &h);
m_graphicContext->ClearRectangle(x, y, w, h);
}
}
void wxGCDCImpl::DoGetSize(int *width, int *height) const