зеркало из https://github.com/mozilla/gecko-dev.git
Bug 710393 - Stop using Math.copySign which doesn't exist on Froyo. r=Cwiiis a=ehsan
This commit is contained in:
Родитель
2931d3a252
Коммит
0fd6d2a2bc
|
@ -781,10 +781,11 @@ public class PanZoomController
|
|||
// If we aren't overscrolled, just apply friction.
|
||||
float excess = getExcess();
|
||||
if (disableSnap || FloatUtils.fuzzyEquals(excess, 0.0f)) {
|
||||
float absvelocity = (float)
|
||||
Math.pow(Math.pow(velocity, FRICTION_FACTOR) * FRICTION,
|
||||
float absvelocity = Math.abs(velocity);
|
||||
absvelocity = (float)Math.pow(Math.pow(absvelocity, FRICTION_FACTOR) * FRICTION,
|
||||
1 / FRICTION_FACTOR);
|
||||
velocity = Math.copySign(absvelocity, velocity);
|
||||
// Math.copySign doesn't exist on Android 2.2
|
||||
velocity = (velocity < 0 ? -absvelocity : absvelocity);
|
||||
|
||||
if (Math.abs(velocity) < 0.1f) {
|
||||
velocity = 0.0f;
|
||||
|
|
Загрузка…
Ссылка в новой задаче