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

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

Issue 212063004: Remove Ununsed Input Variable from ScrollAnimator NotifyPosChange (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 9 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/scroll/ScrollAnimator.h ('k') | Source/platform/scroll/ScrollAnimatorNone.cpp » ('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 412c592362a9d5b9f78c62ab4c674b1767f7d1fa..53d72d2905e374f8b5fbcc9078757223cc475e2b 100644
--- a/Source/platform/scroll/ScrollAnimator.cpp
+++ b/Source/platform/scroll/ScrollAnimator.cpp
@@ -53,25 +53,22 @@ ScrollAnimator::~ScrollAnimator()
bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float delta)
{
- float* currentPos = (orientation == HorizontalScrollbar) ? &m_currentPosX : &m_currentPosY;
- float newPos = clampScrollPosition(orientation, *currentPos + step * delta);
- float scrolledDelta = *currentPos - newPos;
- if (*currentPos == newPos)
+ float& currentPos = (orientation == HorizontalScrollbar) ? m_currentPosX : m_currentPosY;
+ float newPos = clampScrollPosition(orientation, currentPos + step * delta);
+ if (currentPos == newPos)
return false;
- *currentPos = newPos;
+ currentPos = newPos;
- notifyPositionChanged(
- orientation == HorizontalScrollbar ? FloatSize(scrolledDelta, 0) : FloatSize(0, scrolledDelta));
+ notifyPositionChanged();
return true;
}
void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
{
- FloatSize delta = FloatSize(offset.x() - m_currentPosX, offset.y() - m_currentPosY);
m_currentPosX = offset.x();
m_currentPosY = offset.y();
- notifyPositionChanged(delta);
+ notifyPositionChanged();
}
bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
@@ -136,7 +133,7 @@ FloatPoint ScrollAnimator::currentPosition() const
return FloatPoint(m_currentPosX, m_currentPosY);
}
-void ScrollAnimator::notifyPositionChanged(const FloatSize&)
+void ScrollAnimator::notifyPositionChanged()
{
m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
}
« no previous file with comments | « Source/platform/scroll/ScrollAnimator.h ('k') | Source/platform/scroll/ScrollAnimatorNone.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698