[RN] Use default param for elastic bounciness
This commit is contained in:
Родитель
b17b328aed
Коммит
4379aa00de
|
@ -69,10 +69,7 @@ class Easing {
|
|||
* http://tiny.cc/elastic_b_1 (default bounciness = 1)
|
||||
* http://tiny.cc/elastic_b_3 (bounciness = 3)
|
||||
*/
|
||||
static elastic(bounciness: number): (t: number) => number {
|
||||
if (arguments.length === 0) {
|
||||
bounciness = 1;
|
||||
}
|
||||
static elastic(bounciness: number = 1): (t: number) => number {
|
||||
var p = bounciness * Math.PI;
|
||||
return (t) => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p);
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче