added functional test that tests all of the transition easing functions

This commit is contained in:
Eric Rowell
2012-04-03 23:46:59 -07:00
parent 602220bdce
commit 2dff730081
4 changed files with 42 additions and 7 deletions

View File

@@ -355,6 +355,7 @@ Kinetic.Tweens = {
return (a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b);
},
'elastic-ease-in-out': function(t, b, c, d, a, p) {
// added s = 0
var s = 0;
if(t === 0) {
return b;
@@ -392,14 +393,14 @@ Kinetic.Tweens = {
}
},
'bounce-ease-in': function(t, b, c, d) {
return c - Kinetic.Tweens.bounceEaseOut(d - t, 0, c, d) + b;
return c - Kinetic.Tweens['bounce-ease-out'](d - t, 0, c, d) + b;
},
'bounce-ease-in-out': function(t, b, c, d) {
if(t < d / 2) {
return Kinetic.Tweens.bounceEaseIn(t * 2, 0, c, d) * 0.5 + b;
return Kinetic.Tweens['bounce-ease-in'](t * 2, 0, c, d) * 0.5 + b;
}
else {
return Kinetic.Tweens.bounceEaseOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;
return Kinetic.Tweens['bounce-ease-out'](t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;
}
},
// duplicate