зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1091128
- Ensure that large negative velocities are also clamped to the velocity cap. r=botond
This commit is contained in:
Родитель
763598b2af
Коммит
675248424e
|
@ -49,9 +49,16 @@ void Axis::UpdateWithTouchAtDevicePoint(ScreenCoord aPos, uint32_t aTimestampMs)
|
|||
|
||||
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче