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:
parent
89b1446463
commit
d40f860378
@ -638,12 +638,40 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
oldRgn = NewRgn() ;
|
oldRgn = NewRgn() ;
|
||||||
newRgn = NewRgn() ;
|
newRgn = NewRgn() ;
|
||||||
diffRgn = 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(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 ) ;
|
SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ;
|
||||||
DiffRgn( newRgn , oldRgn , diffRgn ) ;
|
DiffRgn( newRgn , oldRgn , diffRgn ) ;
|
||||||
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
||||||
DiffRgn( oldRgn , newRgn , diffRgn ) ;
|
DiffRgn( oldRgn , newRgn , diffRgn ) ;
|
||||||
InvalWindowRgn( (WindowRef) MacGetRootWindow() , 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(oldRgn) ;
|
||||||
DisposeRgn(newRgn) ;
|
DisposeRgn(newRgn) ;
|
||||||
DisposeRgn(diffRgn) ;
|
DisposeRgn(diffRgn) ;
|
||||||
|
@ -638,12 +638,40 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
oldRgn = NewRgn() ;
|
oldRgn = NewRgn() ;
|
||||||
newRgn = NewRgn() ;
|
newRgn = NewRgn() ;
|
||||||
diffRgn = 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(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 ) ;
|
SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ;
|
||||||
DiffRgn( newRgn , oldRgn , diffRgn ) ;
|
DiffRgn( newRgn , oldRgn , diffRgn ) ;
|
||||||
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
||||||
DiffRgn( oldRgn , newRgn , diffRgn ) ;
|
DiffRgn( oldRgn , newRgn , diffRgn ) ;
|
||||||
InvalWindowRgn( (WindowRef) MacGetRootWindow() , 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(oldRgn) ;
|
||||||
DisposeRgn(newRgn) ;
|
DisposeRgn(newRgn) ;
|
||||||
DisposeRgn(diffRgn) ;
|
DisposeRgn(diffRgn) ;
|
||||||
|
Loading…
Reference in New Issue
Block a user