diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index dc6d018fb2..456dc3c1a9 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -1287,28 +1287,20 @@ void wxGCDCImpl::Clear(void) if ( m_backgroundBrush.IsTransparent() ) return; - if ( m_backgroundBrush.IsOk() ) - { - m_graphicContext->SetBrush( m_backgroundBrush ); - wxPen p = *wxTRANSPARENT_PEN; - m_graphicContext->SetPen( p ); - wxCompositionMode formerMode = m_graphicContext->GetCompositionMode(); - m_graphicContext->SetCompositionMode(wxCOMPOSITION_SOURCE); + m_graphicContext->SetBrush( m_backgroundBrush.IsOk() ? m_backgroundBrush + : *wxWHITE_BRUSH ); + wxPen p = *wxTRANSPARENT_PEN; + m_graphicContext->SetPen( p ); + wxCompositionMode formerMode = m_graphicContext->GetCompositionMode(); + m_graphicContext->SetCompositionMode(wxCOMPOSITION_SOURCE); - double x, y, w, h; - m_graphicContext->GetClipBox(&x, &y, &w, &h); - m_graphicContext->DrawRectangle(x, y, w, h); + double x, y, w, h; + m_graphicContext->GetClipBox(&x, &y, &w, &h); + m_graphicContext->DrawRectangle(x, y, w, h); - 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); - } + m_graphicContext->SetCompositionMode(formerMode); + m_graphicContext->SetPen( m_pen ); + m_graphicContext->SetBrush( m_brush ); } void wxGCDCImpl::DoGetSize(int *width, int *height) const