blind fix for trails of border after resize operations
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28701 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
7a96ca3a45
commit
d390fdcf00
@ -1607,9 +1607,49 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
||||
#endif
|
||||
bool vis = m_peer->IsVisible();
|
||||
|
||||
int outerBorder = MacGetLeftBorderSize() ;
|
||||
if ( m_peer->NeedsFocusRect() && m_peer->HasFocus() )
|
||||
outerBorder = 4 ;
|
||||
|
||||
if ( vis && ( outerBorder > 0 ) )
|
||||
{
|
||||
// as the borders are drawn on the parent we have to properly invalidate all these areas
|
||||
RgnHandle updateInner = NewRgn() , updateOuter = NewRgn() , updateTotal = NewRgn() ;
|
||||
|
||||
Rect rect ;
|
||||
|
||||
m_peer->GetRect( &rect ) ;
|
||||
RectRgn( updateInner , &rect ) ;
|
||||
InsetRect( &rect , -outerBorder , -outerBorder ) ;
|
||||
RectRgn( updateOuter , &rect ) ;
|
||||
DiffRgn( updateOuter , updateInner ,updateOuter ) ;
|
||||
wxPoint parent(0,0);
|
||||
GetParent()->MacWindowToRootWindow( &parent.x , &parent.y ) ;
|
||||
parent -= GetParent()->GetClientAreaOrigin() ;
|
||||
OffsetRgn( updateOuter , -parent.x , -parent.y ) ;
|
||||
CopyRgn( updateOuter , updateTotal ) ;
|
||||
|
||||
rect = r ;
|
||||
RectRgn( updateInner , &rect ) ;
|
||||
InsetRect( &rect , -outerBorder , -outerBorder ) ;
|
||||
RectRgn( updateOuter , &rect ) ;
|
||||
DiffRgn( updateOuter , updateInner ,updateOuter ) ;
|
||||
wxPoint parentorig(0,0);
|
||||
GetParent()->MacWindowToRootWindow( &parentorig.x , &parentorig.y ) ;
|
||||
parent -= GetParent()->GetClientAreaOrigin() ;
|
||||
OffsetRgn( updateOuter , -parentorig.x , -parentorig.y ) ;
|
||||
CopyRgn( updateOuter , updateTotal ) ;
|
||||
|
||||
GetParent()->m_peer->SetNeedsDisplay( true , updateTotal ) ;
|
||||
DisposeRgn(updateOuter) ;
|
||||
DisposeRgn(updateInner) ;
|
||||
DisposeRgn(updateTotal) ;
|
||||
}
|
||||
|
||||
// the HIViewSetFrame call itself should invalidate the areas, but when testing with the UnicodeTextCtrl it does not !
|
||||
if ( vis )
|
||||
m_peer->SetVisibility( false , true ) ;
|
||||
|
||||
m_peer->SetRect( &r ) ;
|
||||
if ( vis )
|
||||
m_peer->SetVisibility( true , true ) ;
|
||||
|
Loading…
Reference in New Issue
Block a user