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

Unified Diff: Source/platform/scroll/ScrollAnimator.cpp

Issue 1056983004: OverscrollGlow for mainThread-{BLINK CHANGES} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased to latest Created 5 years, 6 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/page/ChromeClient.h ('k') | Source/platform/scroll/ScrollTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollAnimator.cpp
diff --git a/Source/platform/scroll/ScrollAnimator.cpp b/Source/platform/scroll/ScrollAnimator.cpp
index 0445a856847be87661c7497f178da6e78ffc1a0a..ba1c3023b74767b1b77b417bd22e36aa68e8f907 100644
--- a/Source/platform/scroll/ScrollAnimator.cpp
+++ b/Source/platform/scroll/ScrollAnimator.cpp
@@ -55,7 +55,7 @@ ScrollResultOneDimensional ScrollAnimator::userScroll(ScrollbarOrientation orien
float& currentPos = (orientation == HorizontalScrollbar) ? m_currentPosX : m_currentPosY;
float newPos = clampScrollPosition(orientation, currentPos + step * delta);
if (currentPos == newPos)
- return ScrollResultOneDimensional(false);
+ return ScrollResultOneDimensional(false, delta);
float usedDelta = (newPos - currentPos) / step;
currentPos = newPos;
@@ -84,7 +84,7 @@ ScrollResult ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
float deltaX = canScrollX ? e.deltaX() : 0;
float deltaY = canScrollY ? e.deltaY() : 0;
- ScrollResult result(false);
+ ScrollResult result;
#if !OS(MACOSX)
ScrollGranularity granularity = e.hasPreciseScrollingDeltas() ? ScrollByPrecisePixel : ScrollByPixel;
@@ -95,11 +95,12 @@ ScrollResult ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() - m_scrollableArea->scrollPosition();
IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scrollableArea->minimumScrollPosition();
if ((deltaX < 0 && maxForwardScrollDelta.width() > 0)
- || (deltaX > 0 && maxBackwardScrollDelta.width() > 0)
- || (deltaY < 0 && maxForwardScrollDelta.height() > 0)
- || (deltaY > 0 && maxBackwardScrollDelta.height() > 0)) {
- result.didScroll = true;
-
+ || (deltaX > 0 && maxBackwardScrollDelta.width() > 0))
+ result.didScrollX = true;
+ if ((deltaY < 0 && maxForwardScrollDelta.height() > 0)
+ || (deltaY > 0 && maxBackwardScrollDelta.height() > 0))
+ result.didScrollY = true;
+ if (result.didScroll()) {
if (deltaY) {
if (e.granularity() == ScrollByPageWheelEvent) {
bool negative = deltaY < 0;
« no previous file with comments | « Source/core/page/ChromeClient.h ('k') | Source/platform/scroll/ScrollTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698