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

Unified Diff: Source/platform/mac/ScrollElasticityController.mm

Issue 658953003: Remove redundant Mac event structures (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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/platform/PlatformWheelEvent.h ('k') | Source/web/WebInputEventConversion.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/platform/PlatformWheelEvent.h ('k') | Source/web/WebInputEventConversion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698