Clear does nothing if we have a non valid brush (ie wxNullBrush)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2004-03-28 19:26:21 +00:00
parent 1cb4a8aabe
commit f6809556cf

View File

@@ -1649,10 +1649,9 @@ void wxDC::Clear(void)
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxMacFastPortSetter helper(this) ;
Rect rect = { -31000 , -31000 , 31000 , 31000 } ;
if (m_backgroundBrush.GetStyle() != wxTRANSPARENT)
if ( m_backgroundBrush.Ok() && m_backgroundBrush.GetStyle() != wxTRANSPARENT)
{
::PenNormal() ;
//MacInstallBrush() ;
MacSetupBackgroundForCurrentPort( m_backgroundBrush ) ;
::EraseRect( &rect ) ;
}
@@ -1913,6 +1912,8 @@ void wxDC::MacInstallPen() const
void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
{
Pattern whiteColor ;
if ( background.Ok() )
{
switch( background.MacGetBrushKind() )
{
case kwxMacBrushTheme :
@@ -1946,6 +1947,7 @@ void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
break ;
}
}
}
}
void wxDC::MacInstallBrush() const