Study how to insert easing functions

This commit is contained in:
Balthazar Auger 2012-04-24 00:27:18 -03:00
parent b727ce0fc7
commit b2853e8717
3 changed files with 14 additions and 0 deletions

View file

@ -66,6 +66,7 @@ var filesToInclude = [
'src/util/dom_style.js',
'src/util/dom_misc.js',
'src/util/dom_request.js',
'src/util/anim_ease.js',
ifSpecifiedInclude('parser', 'src/parser.js'),

View file

@ -1313,6 +1313,7 @@
fabric.util.animate({
startValue: options.from,
endValue: to,
easing: options.easing,
duration: options.duration,
onChange: function(value) {
obj.set(property, value);

12
src/util/anim_ease.js Normal file
View file

@ -0,0 +1,12 @@
(function(){
function sine(pos){
return (-Math.cos(pos * Math.PI) / 2) + 0.5;
}
/** @namespace */
fabric.util.ease = {
sine: sine
};
}());