From 8d184de1da31ba4afe670294f0519f025c8043e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 19 Apr 2007 19:36:36 +0000 Subject: [PATCH] * bugfix in ScrollBy (it could scroll the screen area of hidden views) * test the actually visible view area against dirty region, (this avoids making the client window call the Draw() function of views, even though all the drawing would get clipped on the server side) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20756 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/ViewLayer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/servers/app/ViewLayer.cpp b/src/servers/app/ViewLayer.cpp index d180899c42..b83d765ca3 100644 --- a/src/servers/app/ViewLayer.cpp +++ b/src/servers/app/ViewLayer.cpp @@ -965,6 +965,12 @@ ViewLayer::ParentResized(int32 x, int32 y, BRegion* dirtyRegion) void ViewLayer::ScrollBy(int32 x, int32 y, BRegion* dirtyRegion) { + if (!fVisible || !fWindow) { + fScrollingOffset.x += x; + fScrollingOffset.y += y; + return; + } + // blitting version, invalidates // old contents @@ -1412,13 +1418,13 @@ ViewLayer::AddTokensForLayersInRegion(BPrivate::PortLink& link, if (!fVisible) return; -// if (region.Intersects(ScreenClipping(windowContentClipping).Frame())) IntRect screenBounds(Bounds()); ConvertToScreen(&screenBounds); if (!region.Intersects((clipping_rect)screenBounds)) return; - link.Attach(fToken); + if (region.Intersects(ScreenClipping(windowContentClipping).Frame())) + link.Attach(fToken); for (ViewLayer* child = FirstChild(); child; child = child->NextSibling()) child->AddTokensForLayersInRegion(link, region,