Index: Source/platform/mac/ScrollElasticityController.mm |
diff --git a/Source/platform/mac/ScrollElasticityController.mm b/Source/platform/mac/ScrollElasticityController.mm |
index 09e239be00279396468764023ad0d1a8c44f13e8..e01dcabb17a9f9f3b689d8658d1f79245d1ca838 100644 |
--- a/Source/platform/mac/ScrollElasticityController.mm |
+++ b/Source/platform/mac/ScrollElasticityController.mm |
@@ -160,8 +160,10 @@ bool ScrollElasticityController::handleWheelEvent(const PlatformWheelEvent& whee |
if (!shouldHandleEvent(wheelEvent)) |
return false; |
- float deltaX = m_overflowScrollDelta.width(); |
- float deltaY = m_overflowScrollDelta.height(); |
+ float deltaX = m_overflowScrollDelta.width() - wheelEvent.deltaX(); |
+ float deltaY = m_overflowScrollDelta.height() - wheelEvent.deltaY(); |
+ float eventCoalescedDeltaX = -wheelEvent.deltaX(); |
+ float eventCoalescedDeltaY = -wheelEvent.deltaY(); |
// Reset overflow values because we may decide to remove delta at various points and put it into overflow. |
m_overflowScrollDelta = FloatSize(); |
@@ -170,20 +172,6 @@ bool ScrollElasticityController::handleWheelEvent(const PlatformWheelEvent& whee |
bool isVerticallyStretched = stretchAmount.height(); |
bool isHorizontallyStretched = stretchAmount.width(); |
- float eventCoalescedDeltaX; |
- float eventCoalescedDeltaY; |
- |
- if (isVerticallyStretched || isHorizontallyStretched) { |
- eventCoalescedDeltaX = -wheelEvent.unacceleratedScrollingDeltaX(); |
- eventCoalescedDeltaY = -wheelEvent.unacceleratedScrollingDeltaY(); |
- } else { |
- eventCoalescedDeltaX = -wheelEvent.deltaX(); |
- eventCoalescedDeltaY = -wheelEvent.deltaY(); |
- } |
- |
- deltaX += eventCoalescedDeltaX; |
- deltaY += eventCoalescedDeltaY; |
- |
// Slightly prefer scrolling vertically by applying the = case to deltaY |
if (fabsf(deltaY) >= fabsf(deltaX)) |
deltaX = 0; |