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

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

Issue 1018183002: Add rails to input wheel events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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/platform/PlatformWheelEvent.h » ('j') | public/web/WebInputEvent.h » ('J')
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 c3ac77284a4ee16d802e03c09bb0c07eb7e86523..93da2ca3ecedd555b508fd2bc0b98699321de258 100644
--- a/Source/core/frame/PinchViewport.cpp
+++ b/Source/core/frame/PinchViewport.cpp
@@ -450,9 +450,15 @@ ScrollResult PinchViewport::wheelEvent(const PlatformWheelEvent& event)
// Move the location by the negative of the remaining scroll delta.
FloatPoint oldOffset = m_offset;
- FloatPoint locationDelta = viewScrollResult.didScroll ?
- -FloatPoint(viewScrollResult.unusedScrollDeltaX, viewScrollResult.unusedScrollDeltaY) :
- -FloatPoint(event.deltaX(), event.deltaY());
+ FloatPoint locationDelta;
+ if (viewScrollResult.didScroll) {
+ locationDelta = -FloatPoint(viewScrollResult.unusedScrollDeltaX, viewScrollResult.unusedScrollDeltaY);
+ } else {
+ if (event.railMode() != PlatformWheelEventRailModeVertical)
+ locationDelta.setX(-event.deltaX());
+ if (event.railMode() != PlatformWheelEventRailModeHorizontal)
+ locationDelta.setY(-event.deltaY());
+ }
move(locationDelta);
FloatPoint usedLocationDelta(m_offset - oldOffset);
« no previous file with comments | « no previous file | Source/platform/PlatformWheelEvent.h » ('j') | public/web/WebInputEvent.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698