mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1603224
- Guard against division-by-zero in AsyncPanZoomController::ScrollSnapToDestination(). r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D57179 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
eb86e49693
commit
19311b0174
@ -5296,10 +5296,10 @@ void AsyncPanZoomController::ScrollSnapToDestination() {
|
||||
ParentLayerPoint predictedDelta;
|
||||
// "-velocity / log(1.0 - friction)" is the integral of the deceleration
|
||||
// curve modeled for flings in the "Axis" class.
|
||||
if (velocity.x != 0.0f) {
|
||||
if (velocity.x != 0.0f && friction != 0.0f) {
|
||||
predictedDelta.x = -velocity.x / log(1.0 - friction);
|
||||
}
|
||||
if (velocity.y != 0.0f) {
|
||||
if (velocity.y != 0.0f && friction != 0.0f) {
|
||||
predictedDelta.y = -velocity.y / log(1.0 - friction);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user