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); |