mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-05 04:14:54 +00:00
Merge pull request #358 from raiden-dev/master
[BACK_INCOMPAT] Change the way relative animations are specified.
This commit is contained in:
commit
0326af39ca
4 changed files with 19 additions and 9 deletions
8
dist/all.js
vendored
8
dist/all.js
vendored
|
|
@ -10039,14 +10039,18 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|||
_animate: function(property, to, options) {
|
||||
var obj = this;
|
||||
|
||||
to = to.toString();
|
||||
options || (options = { });
|
||||
|
||||
if (!('from' in options)) {
|
||||
options.from = this.get(property);
|
||||
}
|
||||
|
||||
if (/[+\-]/.test((to + '').charAt(0))) {
|
||||
to = this.get(property) + parseFloat(to);
|
||||
if (~to.indexOf('=')) {
|
||||
to = this.get(property) + parseFloat(to.replace('=', ''));
|
||||
}
|
||||
else {
|
||||
to = parseFloat(to);
|
||||
}
|
||||
|
||||
fabric.util.animate({
|
||||
|
|
|
|||
12
dist/all.min.js
vendored
12
dist/all.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/all.min.js.gz
vendored
BIN
dist/all.min.js.gz
vendored
Binary file not shown.
|
|
@ -1592,14 +1592,18 @@
|
|||
_animate: function(property, to, options) {
|
||||
var obj = this;
|
||||
|
||||
to = to.toString();
|
||||
options || (options = { });
|
||||
|
||||
if (!('from' in options)) {
|
||||
options.from = this.get(property);
|
||||
}
|
||||
|
||||
if (/[+\-]/.test((to + '').charAt(0))) {
|
||||
to = this.get(property) + parseFloat(to);
|
||||
if (~to.indexOf('=')) {
|
||||
to = this.get(property) + parseFloat(to.replace('=', ''));
|
||||
}
|
||||
else {
|
||||
to = parseFloat(to);
|
||||
}
|
||||
|
||||
fabric.util.animate({
|
||||
|
|
|
|||
Loading…
Reference in a new issue