Bug 1068571 - Clear velocity on touch-end even if in the NOTHING state. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 01 Oct 2014 17:49:30 -0400
changeset 208305 40c2c60d766606a02118ec32ba2552b911ed1ef0
parent 208304 812bc959f32bd936fd5c5d1f62cc883f114adad1
child 208306 1c4d997e2260f1e6b972cfdd97dc93425c32fb78
push id49892
push userkgupta@mozilla.com
push dateThu, 02 Oct 2014 01:08:11 +0000
treeherdermozilla-inbound@0b4ff0427b86 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1068571
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1068571 - Clear velocity on touch-end even if in the NOTHING state. r=botond
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -1284,16 +1284,20 @@ nsEventStatus AsyncPanZoomController::On
   case NOTHING:
     // May happen if the user double-taps and drags without lifting after the
     // second tap. Ignore if this happens.
     return nsEventStatus_eIgnore;
 
   case TOUCHING:
   case CROSS_SLIDING_X:
   case CROSS_SLIDING_Y:
+    // We may have some velocity stored on the axis from move events
+    // that were not big enough to trigger scrolling. Clear that out.
+    mX.SetVelocity(0);
+    mY.SetVelocity(0);
     SetState(NOTHING);
     return nsEventStatus_eIgnore;
 
   case PANNING:
   case PANNING_LOCKED_X:
   case PANNING_LOCKED_Y:
   {
     CurrentTouchBlock()->GetOverscrollHandoffChain()->FlushRepaints();