Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(564)

Unified Diff: Source/core/frame/PinchViewport.cpp

Issue 853103003: Fix drag-and-drop autoscrolling with --enable-pinch-virtual-viewport (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/PinchViewport.cpp
diff --git a/Source/core/frame/PinchViewport.cpp b/Source/core/frame/PinchViewport.cpp
index ffe9f13419e98bfa2b79f3f1c4845bf13718bfce..39c250f02d7619beeab8ce7c778540acd18f3c97 100644
--- a/Source/core/frame/PinchViewport.cpp
+++ b/Source/core/frame/PinchViewport.cpp
@@ -149,15 +149,18 @@ void PinchViewport::scrollIntoView(const LayoutRect& rect)
FrameView* view = mainFrame()->view();
- // Snap the visible rect to layout units to match the input rect.
- FloatRect visible = LayoutRect(visibleRect());
+ // Snap the visible rect to layout units to match the input rect. Intersect
+ // with the FrameView so that we exclude scrollbars from the visible area.
+ FloatRect visible = intersection(
+ LayoutRect(visibleRectInDocument()),
+ LayoutRect(view->visibleContentRect()));
float centeringOffsetX = (visible.width() - rect.width()) / 2;
float centeringOffsetY = (visible.height() - rect.height()) / 2;
DoublePoint targetOffset(
- rect.x() - centeringOffsetX - visible.x(),
- rect.y() - centeringOffsetY - visible.y());
bokan 2015/01/15 23:53:01 visibleRect() is relative to the FrameView, since
+ rect.x() - centeringOffsetX,
+ rect.y() - centeringOffsetY);
view->setScrollPosition(targetOffset);
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698