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

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: More plumbing and tests 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 | « Source/core/events/WheelEvent.cpp ('k') | Source/platform/PlatformEvent.h » ('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 c3ac77284a4ee16d802e03c09bb0c07eb7e86523..bf612bdd44bf788abec7a660f9af1e61bde6955a 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.railsMode() != PlatformEvent::RailsModeVertical)
+ locationDelta.setX(-event.deltaX());
+ if (event.railsMode() != PlatformEvent::RailsModeHorizontal)
+ locationDelta.setY(-event.deltaY());
+ }
move(locationDelta);
FloatPoint usedLocationDelta(m_offset - oldOffset);
« no previous file with comments | « Source/core/events/WheelEvent.cpp ('k') | Source/platform/PlatformEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698