fixing update area being to big

see #19111
This commit is contained in:
Stefan Csomor
2021-04-03 18:30:57 +02:00
parent 152a2079b4
commit 767de514c1

View File

@@ -3063,6 +3063,23 @@ void SetSubviewsNeedDisplay( NSView *view )
}
}
void SetSubviewsNeedDisplay( NSView *view, NSRect rect )
{
for ( NSView *sub in view.subviews )
{
if ( sub.isHidden )
continue;
NSRect intersect = NSIntersectionRect(sub.frame, rect);
if ( !NSIsEmptyRect(intersect) )
{
intersect = [view convertRect:intersect toView:sub];
[sub setNeedsDisplayInRect:intersect];
SetSubviewsNeedDisplay(sub, intersect);
}
}
}
}
#endif
@@ -3081,7 +3098,12 @@ void wxWidgetCocoaImpl::SetNeedsDisplay( const wxRect* where )
// do it manually here:
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14
if ( WX_IS_MACOS_AVAILABLE(10, 14 ) )
SetSubviewsNeedDisplay(m_osxView);
{
if ( where )
SetSubviewsNeedDisplay(m_osxView, wxToNSRect(m_osxView, *where ));
else
SetSubviewsNeedDisplay(m_osxView);
}
#endif
}