Commit 48f438e8 authored by Markus Stange's avatar Markus Stange
Browse files

Bug 1229125 - Correct velocity computation for pan gesture events. r=botond

When scrolling down, panInput.mLocalDisplacement.y will be positive, so
aAdditionalDelta will be positive, and newVelocity must be positive.

--HG--
extra : commitid : GlT0IqOWqiI
extra : rebase_source : 2fc0347d943ac7bf8eac2f2da6f7b6b217bdbe0d
parent bb992fcd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ void Axis::UpdateWithTouchAtDevicePoint(ParentLayerCoord aPos, ParentLayerCoord
    return;
  }

  float newVelocity = mAxisLocked ? 0.0f : (float)(mPos - aPos - aAdditionalDelta) / (float)(aTimestampMs - mPosTimeMs);
  float newVelocity = mAxisLocked ? 0.0f : (float)(mPos - aPos + aAdditionalDelta) / (float)(aTimestampMs - mPosTimeMs);
  if (gfxPrefs::APZMaxVelocity() > 0.0f) {
    bool velocityIsNegative = (newVelocity < 0);
    newVelocity = fabs(newVelocity);