correcting a missing redraw area on certain resize operations when window has a border

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2004-02-06 13:20:02 +00:00
parent 89b1446463
commit d40f860378
2 changed files with 56 additions and 0 deletions

View File

@ -638,12 +638,40 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
oldRgn = NewRgn() ;
newRgn = NewRgn() ;
diffRgn = NewRgn() ;
// invalidate the differences between the old and the new area
SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ;
SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ;
DiffRgn( newRgn , oldRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
DiffRgn( oldRgn , newRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
// we also must invalidate the border areas, someone might optimize this one day to invalidate only the really
// changing pixels...
if ( MacGetLeftBorderSize() != 0 || MacGetRightBorderSize() != 0 ||
MacGetTopBorderSize() != 0 || MacGetBottomBorderSize() != 0 )
{
RgnHandle innerOldRgn, innerNewRgn ;
innerOldRgn = NewRgn() ;
innerNewRgn = NewRgn() ;
SetRectRgn(innerOldRgn , oldPos.x + MacGetLeftBorderSize() , oldPos.y + MacGetTopBorderSize() ,
oldPos.x + m_width - MacGetRightBorderSize() , oldPos.y + m_height - MacGetBottomBorderSize() ) ;
DiffRgn( oldRgn , innerOldRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
SetRectRgn(innerNewRgn , newPos.x + MacGetLeftBorderSize() , newPos.y + MacGetTopBorderSize() ,
newPos.x + actualWidth - MacGetRightBorderSize() , newPos.y + actualHeight - MacGetBottomBorderSize() ) ;
DiffRgn( newRgn , innerNewRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
DisposeRgn( innerOldRgn ) ;
DisposeRgn( innerNewRgn ) ;
}
DisposeRgn(oldRgn) ;
DisposeRgn(newRgn) ;
DisposeRgn(diffRgn) ;

View File

@ -638,12 +638,40 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
oldRgn = NewRgn() ;
newRgn = NewRgn() ;
diffRgn = NewRgn() ;
// invalidate the differences between the old and the new area
SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ;
SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ;
DiffRgn( newRgn , oldRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
DiffRgn( oldRgn , newRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
// we also must invalidate the border areas, someone might optimize this one day to invalidate only the really
// changing pixels...
if ( MacGetLeftBorderSize() != 0 || MacGetRightBorderSize() != 0 ||
MacGetTopBorderSize() != 0 || MacGetBottomBorderSize() != 0 )
{
RgnHandle innerOldRgn, innerNewRgn ;
innerOldRgn = NewRgn() ;
innerNewRgn = NewRgn() ;
SetRectRgn(innerOldRgn , oldPos.x + MacGetLeftBorderSize() , oldPos.y + MacGetTopBorderSize() ,
oldPos.x + m_width - MacGetRightBorderSize() , oldPos.y + m_height - MacGetBottomBorderSize() ) ;
DiffRgn( oldRgn , innerOldRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
SetRectRgn(innerNewRgn , newPos.x + MacGetLeftBorderSize() , newPos.y + MacGetTopBorderSize() ,
newPos.x + actualWidth - MacGetRightBorderSize() , newPos.y + actualHeight - MacGetBottomBorderSize() ) ;
DiffRgn( newRgn , innerNewRgn , diffRgn ) ;
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
DisposeRgn( innerOldRgn ) ;
DisposeRgn( innerNewRgn ) ;
}
DisposeRgn(oldRgn) ;
DisposeRgn(newRgn) ;
DisposeRgn(diffRgn) ;