wxDFB: fix rendering artefacts when scrolling wxScrolledWindow that contains other widgets
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -492,6 +492,15 @@ void wxWindowDFB::DoMoveWindow(int x, int y, int width, int height)
|
||||
{
|
||||
// queue both former and new position of the window for repainting:
|
||||
wxWindow *parent = GetParent();
|
||||
|
||||
// only refresh the visible parts:
|
||||
if ( !CanBeOutsideClientArea() )
|
||||
{
|
||||
wxRect parentClient(parent->GetClientSize());
|
||||
oldpos.Intersect(parentClient);
|
||||
newpos.Intersect(parentClient);
|
||||
}
|
||||
|
||||
parent->RefreshRect(oldpos);
|
||||
parent->RefreshRect(newpos);
|
||||
}
|
||||
@@ -682,6 +691,11 @@ void wxWindowDFB::DoRefreshRect(const wxRect& rect)
|
||||
r.Offset(GetPosition());
|
||||
r.Offset(parent->GetClientAreaOrigin());
|
||||
|
||||
// normal windows cannot extend out of its parent's client area, so don't
|
||||
// refresh any hidden parts:
|
||||
if ( !CanBeOutsideClientArea() )
|
||||
r.Intersect(parent->GetClientRect());
|
||||
|
||||
parent->DoRefreshRect(r);
|
||||
}
|
||||
|
||||
@@ -763,6 +777,10 @@ void wxWindowDFB::PaintWindow(const wxRect& rect)
|
||||
|
||||
m_updateRegion.Clear();
|
||||
|
||||
// client area portion of 'rect':
|
||||
wxRect rectClientOnly(rect);
|
||||
rectClientOnly.Intersect(clientRect);
|
||||
|
||||
// paint the children:
|
||||
wxPoint origin = GetClientAreaOrigin();
|
||||
wxWindowList& children = GetChildren();
|
||||
@@ -777,7 +795,12 @@ void wxWindowDFB::PaintWindow(const wxRect& rect)
|
||||
// compute child's area to repaint
|
||||
wxRect childrect(child->GetRect());
|
||||
childrect.Offset(origin);
|
||||
childrect.Intersect(rect);
|
||||
|
||||
if ( child->CanBeOutsideClientArea() )
|
||||
childrect.Intersect(rect);
|
||||
else
|
||||
childrect.Intersect(rectClientOnly);
|
||||
|
||||
if ( childrect.IsEmpty() )
|
||||
continue;
|
||||
|
||||
|
Reference in New Issue
Block a user