corrected bug in MacRedraw

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2001-12-20 06:42:38 +00:00
parent c59ceaaaf0
commit e8788ed0c6
2 changed files with 6 additions and 12 deletions

View File

@@ -1440,8 +1440,6 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time, bool erase)
CopyRgn( updatergn , ownUpdateRgn ) ; CopyRgn( updatergn , ownUpdateRgn ) ;
// subtract all children from updatergn, as soon as we start with transparent windows, these should // subtract all children from updatergn, as soon as we start with transparent windows, these should
// not be subtracted // not be subtracted
RgnHandle eraseRgn = NewRgn() ;
CopyRgn( ownUpdateRgn , eraseRgn ) ;
RgnHandle childarea = NewRgn() ; RgnHandle childarea = NewRgn() ;
for (wxNode *node = GetChildren().First(); node; node = node->Next()) for (wxNode *node = GetChildren().First(); node; node = node->Next())
@@ -1451,7 +1449,7 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time, bool erase)
if ( child->MacGetRootWindow() == window && child->IsShown() ) if ( child->MacGetRootWindow() == window && child->IsShown() )
{ {
SetRectRgn( childarea , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ; SetRectRgn( childarea , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ;
DiffRgn( eraseRgn , childarea , eraseRgn ) ; DiffRgn( ownUpdateRgn , childarea , ownUpdateRgn ) ;
} }
} }
DisposeRgn( childarea ) ; DisposeRgn( childarea ) ;
@@ -1468,10 +1466,10 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time, bool erase)
OffsetRgn( newupdate , -origin.x , -origin.y ) ; OffsetRgn( newupdate , -origin.x , -origin.y ) ;
m_updateRegion = newupdate ; m_updateRegion = newupdate ;
DisposeRgn( newupdate ) ; // it's been cloned to m_updateRegion DisposeRgn( newupdate ) ; // it's been cloned to m_updateRegion
if ( erase && !EmptyRgn(eraseRgn) ) if ( erase && !EmptyRgn(ownUpdateRgn) )
{ {
wxWindowDC dc(this); wxWindowDC dc(this);
dc.SetClippingRegion(wxRegion(eraseRgn)); dc.SetClippingRegion(wxRegion(ownUpdateRgn));
wxEraseEvent eevent( GetId(), &dc ); wxEraseEvent eevent( GetId(), &dc );
eevent.SetEventObject( this ); eevent.SetEventObject( this );
GetEventHandler()->ProcessEvent( eevent ); GetEventHandler()->ProcessEvent( eevent );
@@ -1481,7 +1479,6 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time, bool erase)
GetEventHandler()->ProcessEvent( eventNc ); GetEventHandler()->ProcessEvent( eventNc );
} }
DisposeRgn( ownUpdateRgn ) ; DisposeRgn( ownUpdateRgn ) ;
DisposeRgn( eraseRgn ) ;
if ( !m_updateRegion.Empty() ) if ( !m_updateRegion.Empty() )
{ {
wxPaintEvent event; wxPaintEvent event;

View File

@@ -1440,8 +1440,6 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time, bool erase)
CopyRgn( updatergn , ownUpdateRgn ) ; CopyRgn( updatergn , ownUpdateRgn ) ;
// subtract all children from updatergn, as soon as we start with transparent windows, these should // subtract all children from updatergn, as soon as we start with transparent windows, these should
// not be subtracted // not be subtracted
RgnHandle eraseRgn = NewRgn() ;
CopyRgn( ownUpdateRgn , eraseRgn ) ;
RgnHandle childarea = NewRgn() ; RgnHandle childarea = NewRgn() ;
for (wxNode *node = GetChildren().First(); node; node = node->Next()) for (wxNode *node = GetChildren().First(); node; node = node->Next())
@@ -1451,7 +1449,7 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time, bool erase)
if ( child->MacGetRootWindow() == window && child->IsShown() ) if ( child->MacGetRootWindow() == window && child->IsShown() )
{ {
SetRectRgn( childarea , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ; SetRectRgn( childarea , child->m_x , child->m_y , child->m_x + child->m_width , child->m_y + child->m_height ) ;
DiffRgn( eraseRgn , childarea , eraseRgn ) ; DiffRgn( ownUpdateRgn , childarea , ownUpdateRgn ) ;
} }
} }
DisposeRgn( childarea ) ; DisposeRgn( childarea ) ;
@@ -1468,10 +1466,10 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time, bool erase)
OffsetRgn( newupdate , -origin.x , -origin.y ) ; OffsetRgn( newupdate , -origin.x , -origin.y ) ;
m_updateRegion = newupdate ; m_updateRegion = newupdate ;
DisposeRgn( newupdate ) ; // it's been cloned to m_updateRegion DisposeRgn( newupdate ) ; // it's been cloned to m_updateRegion
if ( erase && !EmptyRgn(eraseRgn) ) if ( erase && !EmptyRgn(ownUpdateRgn) )
{ {
wxWindowDC dc(this); wxWindowDC dc(this);
dc.SetClippingRegion(wxRegion(eraseRgn)); dc.SetClippingRegion(wxRegion(ownUpdateRgn));
wxEraseEvent eevent( GetId(), &dc ); wxEraseEvent eevent( GetId(), &dc );
eevent.SetEventObject( this ); eevent.SetEventObject( this );
GetEventHandler()->ProcessEvent( eevent ); GetEventHandler()->ProcessEvent( eevent );
@@ -1481,7 +1479,6 @@ void wxWindowMac::MacRedraw( RgnHandle updatergn , long time, bool erase)
GetEventHandler()->ProcessEvent( eventNc ); GetEventHandler()->ProcessEvent( eventNc );
} }
DisposeRgn( ownUpdateRgn ) ; DisposeRgn( ownUpdateRgn ) ;
DisposeRgn( eraseRgn ) ;
if ( !m_updateRegion.Empty() ) if ( !m_updateRegion.Empty() )
{ {
wxPaintEvent event; wxPaintEvent event;