diff options
Diffstat (limited to 'WebCore/platform/ScrollAnimatorWin.cpp')
-rw-r--r-- | WebCore/platform/ScrollAnimatorWin.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/WebCore/platform/ScrollAnimatorWin.cpp b/WebCore/platform/ScrollAnimatorWin.cpp index 8b7d0f6..025aa71 100644 --- a/WebCore/platform/ScrollAnimatorWin.cpp +++ b/WebCore/platform/ScrollAnimatorWin.cpp @@ -29,6 +29,9 @@ */ #include "config.h" + +#if ENABLE(SMOOTH_SCROLLING) + #include "ScrollAnimatorWin.h" #include "ScrollbarClient.h" @@ -128,7 +131,7 @@ bool ScrollAnimatorWin::scroll(ScrollbarOrientation orientation, ScrollGranulari // velocity needed to stay smoothly in sync with the user's actions; for // events that come slower, we'll scroll one increment and then pause until // the next event fires. - float animationStep = abs(newPos - *data->m_currentPos); + float animationStep = fabs(newPos - *data->m_currentPos); // If a key is held down (or the wheel continually spun), then once we have // reached a velocity close to the steady-state velocity, we're likely to // hit the desired position at around the same time we'd expect the next @@ -275,7 +278,7 @@ void ScrollAnimatorWin::animateScroll(PerAxisData* data) } // Now update the scroll position based on the distance traveled. - if (distanceTraveled >= abs(data->m_desiredPos - *data->m_currentPos)) { + if (distanceTraveled >= fabs(data->m_desiredPos - *data->m_currentPos)) { // We've traveled far enough to reach the desired position. Stop smooth // scrolling. *data->m_currentPos = data->m_desiredPos; @@ -294,3 +297,5 @@ void ScrollAnimatorWin::animateScroll(PerAxisData* data) } } // namespace WebCore + +#endif // ENABLE(SMOOTH_SCROLLING) |