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

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

Issue 1202763005: Scroll only visual viewport during OSX pinch gesture behind flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | Source/core/frame/Settings.in » ('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 4b20bc08d9ebbdac6c12b02cd6552e09909130d8..4bf57b5f645b9af7b020a791c6e63a6f6956ec30 100644
--- a/Source/core/frame/PinchViewport.cpp
+++ b/Source/core/frame/PinchViewport.cpp
@@ -239,11 +239,14 @@ bool PinchViewport::magnifyScaleAroundAnchor(float magnifyDelta, const FloatPoin
// First try to use the anchor's delta to scroll the FrameView.
FloatSize anchorDeltaUnusedByScroll = anchorDelta;
- FrameView* view = mainFrame()->view();
- DoublePoint oldPosition = view->scrollPositionDouble();
- view->scrollBy(DoubleSize(anchorDelta.width(), anchorDelta.height()), UserScroll);
- DoublePoint newPosition = view->scrollPositionDouble();
- anchorDeltaUnusedByScroll = anchorDelta - toFloatSize(newPosition - oldPosition);
+
+ if (!frameHost().settings().invertViewportScrollOrder()) {
+ FrameView* view = mainFrame()->view();
+ DoublePoint oldPosition = view->scrollPositionDouble();
+ view->scrollBy(DoubleSize(anchorDelta.width(), anchorDelta.height()), UserScroll);
+ DoublePoint newPosition = view->scrollPositionDouble();
+ anchorDeltaUnusedByScroll -= toFloatSize(newPosition - oldPosition);
+ }
// Manually bubble any remaining anchor delta up to the pinch viewport.
FloatPoint newLocation(location() + anchorDeltaUnusedByScroll);
« no previous file with comments | « no previous file | Source/core/frame/Settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698