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

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

Issue 1496693005: Update RootFrameViewport::userScroll to distribute scrolls between viewports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed remaining review comments Created 5 years 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
Index: third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
index a6dc9bffc3c47ebd627718a9fbf18deb93ab410c..3a795584d4ca0355b0694de10fcc9ff93bd3c419 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
@@ -59,6 +59,15 @@ ScrollAnimator::~ScrollAnimator()
cancelAnimations();
}
+float ScrollAnimator::usedScrollDelta(ScrollbarOrientation orientation, float pixelDelta) const
bokan 2015/12/07 18:43:17 I'd make this "computeTargetPosition" and use it i
bokan 2015/12/07 19:52:54 ok, delta is fine, but can we call it 'computeDelt
ymalik 2015/12/07 20:52:33 Renamed.
+{
+ FloatPoint pos = m_animationCurve
+ ? FloatPoint(m_animationCurve->targetValue()) : currentPosition();
+ float currentPos = (orientation == HorizontalScrollbar) ? pos.x() : pos.y();
+ float newPos = clampScrollPosition(orientation, currentPos + pixelDelta);
+ return (currentPos == newPos) ? 0.0f : (newPos - currentPos);
+}
+
ScrollResultOneDimensional ScrollAnimator::userScroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float delta)
{
if (!m_scrollableArea->scrollAnimatorEnabled())

Powered by Google App Engine
This is Rietveld 408576698