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:
@@ -1287,28 +1287,20 @@ void wxGCDCImpl::Clear(void)
|
|||||||
if ( m_backgroundBrush.IsTransparent() )
|
if ( m_backgroundBrush.IsTransparent() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( m_backgroundBrush.IsOk() )
|
m_graphicContext->SetBrush( m_backgroundBrush.IsOk() ? m_backgroundBrush
|
||||||
{
|
: *wxWHITE_BRUSH );
|
||||||
m_graphicContext->SetBrush( m_backgroundBrush );
|
wxPen p = *wxTRANSPARENT_PEN;
|
||||||
wxPen p = *wxTRANSPARENT_PEN;
|
m_graphicContext->SetPen( p );
|
||||||
m_graphicContext->SetPen( p );
|
wxCompositionMode formerMode = m_graphicContext->GetCompositionMode();
|
||||||
wxCompositionMode formerMode = m_graphicContext->GetCompositionMode();
|
m_graphicContext->SetCompositionMode(wxCOMPOSITION_SOURCE);
|
||||||
m_graphicContext->SetCompositionMode(wxCOMPOSITION_SOURCE);
|
|
||||||
|
|
||||||
double x, y, w, h;
|
double x, y, w, h;
|
||||||
m_graphicContext->GetClipBox(&x, &y, &w, &h);
|
m_graphicContext->GetClipBox(&x, &y, &w, &h);
|
||||||
m_graphicContext->DrawRectangle(x, y, w, h);
|
m_graphicContext->DrawRectangle(x, y, w, h);
|
||||||
|
|
||||||
m_graphicContext->SetCompositionMode(formerMode);
|
m_graphicContext->SetCompositionMode(formerMode);
|
||||||
m_graphicContext->SetPen( m_pen );
|
m_graphicContext->SetPen( m_pen );
|
||||||
m_graphicContext->SetBrush( m_brush );
|
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
|
void wxGCDCImpl::DoGetSize(int *width, int *height) const
|
||||||
|
Reference in New Issue
Block a user