mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Mac: fix repaint artifacts introduced by issue #360 when overlapping elements are scrolled.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@319 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -61,8 +61,8 @@ void WebWidgetHost::DidInvalidateRect(const gfx::Rect& damaged_rect) {
|
|||||||
void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) {
|
void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) {
|
||||||
DCHECK(dx || dy);
|
DCHECK(dx || dy);
|
||||||
|
|
||||||
gfx::Rect client_rect(NSRectToCGRect([view_ bounds]));
|
const gfx::Rect client_rect(NSRectToCGRect([view_ bounds]));
|
||||||
gfx::Rect rect = clip_rect.Intersect(client_rect);
|
const gfx::Rect rect = clip_rect.Intersect(client_rect);
|
||||||
|
|
||||||
// Convert scroll rectangle to the view's coordinate system, and perform the
|
// Convert scroll rectangle to the view's coordinate system, and perform the
|
||||||
// scroll directly, without invalidating the view. In theory this could cause
|
// scroll directly, without invalidating the view. In theory this could cause
|
||||||
@ -105,6 +105,16 @@ void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) {
|
|||||||
paint_rect_ = gfx::Rect(rect.x(), rect.y() + dy, rect.width(), -dx);
|
paint_rect_ = gfx::Rect(rect.x(), rect.y() + dy, rect.width(), -dx);
|
||||||
Paint();
|
Paint();
|
||||||
|
|
||||||
|
// If any part of the scrolled rect was marked as dirty, make sure to redraw
|
||||||
|
// it in the new scrolled-to location. Otherwise we can end up with artifacts
|
||||||
|
// for overlapping elements.
|
||||||
|
gfx::Rect moved_paint_rect = saved_paint_rect.Intersect(clip_rect);
|
||||||
|
if (!moved_paint_rect.IsEmpty()) {
|
||||||
|
moved_paint_rect.Offset(dx, dy);
|
||||||
|
paint_rect_ = moved_paint_rect;
|
||||||
|
Paint();
|
||||||
|
}
|
||||||
|
|
||||||
paint_rect_ = saved_paint_rect;
|
paint_rect_ = saved_paint_rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user