mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-02 02:54:43 +00:00
Study how to insert easing functions
This commit is contained in:
parent
b727ce0fc7
commit
b2853e8717
3 changed files with 14 additions and 0 deletions
1
build.js
1
build.js
|
|
@ -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'),
|
||||
|
||||
|
|
|
|||
|
|
@ -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
12
src/util/anim_ease.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(function(){
|
||||
|
||||
function sine(pos){
|
||||
return (-Math.cos(pos * Math.PI) / 2) + 0.5;
|
||||
}
|
||||
|
||||
/** @namespace */
|
||||
fabric.util.ease = {
|
||||
sine: sine
|
||||
};
|
||||
|
||||
}());
|
||||
Loading…
Reference in a new issue