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

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

Issue 14703004: Reland "Unifies ScrollView and RenderLayer to use non-shi..." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years, 7 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/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp ('k') | Source/core/platform/ScrollView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/ScrollAnimator.cpp
diff --git a/Source/core/platform/ScrollAnimator.cpp b/Source/core/platform/ScrollAnimator.cpp
index 0faa0c046e939e7aabe1d7bde49656b2a2b0616d..dc0c7f3a29422d3883d60ce45aa8c8dfb230d90c 100644
--- a/Source/core/platform/ScrollAnimator.cpp
+++ b/Source/core/platform/ScrollAnimator.cpp
@@ -55,7 +55,7 @@ ScrollAnimator::~ScrollAnimator()
bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
{
float* currentPos = (orientation == HorizontalScrollbar) ? &m_currentPosX : &m_currentPosY;
- float newPos = std::max(std::min(*currentPos + (step * multiplier), static_cast<float>(m_scrollableArea->scrollSize(orientation))), 0.0f);
+ float newPos = m_scrollableArea->clampScrollPosition(orientation, *currentPos + step * multiplier);
float delta = *currentPos - newPos;
if (*currentPos == newPos)
return false;
« no previous file with comments | « Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp ('k') | Source/core/platform/ScrollView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698