author | Kartikaya Gupta <kgupta@mozilla.com> |
Wed, 29 Oct 2014 15:40:02 -0400 | |
changeset 213078 | 08655880fafcd9aa67d61b0ac421c9b7e96c4409 |
parent 213077 | 2f7b39a26383401515d091f07df68e67899317ad |
child 213079 | d81c4d490c107b4b90d5422e51ad83fa26f09a1b |
push id | 51143 |
push user | cbook@mozilla.com |
push date | Thu, 30 Oct 2014 14:14:04 +0000 |
treeherder | mozilla-inbound@e80345c5bf6f [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | botond |
bugs | 1091128 |
milestone | 36.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
|
--- a/gfx/layers/apz/src/Axis.cpp +++ b/gfx/layers/apz/src/Axis.cpp @@ -44,19 +44,26 @@ void Axis::UpdateWithTouchAtDevicePoint( // update mPos so we don't run into problems like bug 1042734, even though // that means the velocity will be stale. Better than doing a divide-by-zero. mPos = aPos; return; } float newVelocity = mAxisLocked ? 0.0f : (float)(mPos - aPos) / (float)(aTimestampMs - mPosTimeMs); if (gfxPrefs::APZMaxVelocity() > 0.0f) { + bool velocityIsNegative = (newVelocity < 0); + newVelocity = fabs(newVelocity); + ScreenPoint maxVelocity = MakePoint(gfxPrefs::APZMaxVelocity() * APZCTreeManager::GetDPI()); mAsyncPanZoomController->ToLocalScreenCoordinates(&maxVelocity, mAsyncPanZoomController->PanStart()); newVelocity = std::min(newVelocity, maxVelocity.Length()); + + if (velocityIsNegative) { + newVelocity = -newVelocity; + } } mVelocity = newVelocity; mPos = aPos; mPosTimeMs = aTimestampMs; // Limit queue size pased on pref mVelocityQueue.AppendElement(std::make_pair(aTimestampMs, mVelocity));