Bug 1280580 - Android native fling animation is returning an inverted velocity. r=kats, a=gchang
authorRandall Barker <rbarker@mozilla.com>
Thu, 16 Jun 2016 16:40:28 +0100
changeset 341754 fb650a44de9ebb79104dd29b9534827398bf40de
parent 341753 a9e1fd7149e0ee37e1ddc5f4157506110e779ecf
child 341755 98142136966aac95c83984dc9fd9b8b984fbd571
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, gchang
bugs1280580
milestone49.0a2
Bug 1280580 - Android native fling animation is returning an inverted velocity. r=kats, a=gchang
gfx/layers/apz/src/AndroidAPZ.cpp
--- a/gfx/layers/apz/src/AndroidAPZ.cpp
+++ b/gfx/layers/apz/src/AndroidAPZ.cpp
@@ -132,17 +132,17 @@ AndroidFlingAnimation::DoSample(FrameMet
   ParentLayerPoint velocity = mPreviousVelocity;
 
   // Sometimes the OverScroller fails to update the offset for a frame.
   // If the frame can still scroll we just use the velocity from the previous
   // frame. However, if the frame can no longer scroll in the direction
   // of the fling, then end the animation.
   if (offset != mPreviousOffset) {
     if (aDelta.ToMilliseconds() > 0) {
-      velocity = (mPreviousOffset - offset) / (float)aDelta.ToMilliseconds();
+      velocity = (offset - mPreviousOffset) / (float)aDelta.ToMilliseconds();
       mPreviousVelocity = velocity;
     }
   } else if (hitBoundX || hitBoundY) {
     // We have reached the end of the scroll in one of the directions being scrolled and the offset has not
     // changed so end animation.
     shouldContinueFling = false;
   }