diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-04-03 13:11:41 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-04-03 13:11:41 +0200 |
commit | 8bdc17f571d428a62afaf5853679378047b5aafd (patch) | |
tree | 01a5d8b2b8cc8c1d286640d2fea6ca20ab898d7d /src | |
parent | 528637eb862877ca60cfa311eb54c6384566f831 (diff) | |
download | svg.js-8bdc17f571d428a62afaf5853679378047b5aafd.tar.gz svg.js-8bdc17f571d428a62afaf5853679378047b5aafd.zip |
fixed `SVG.morph()` (#473)
Diffstat (limited to 'src')
-rw-r--r-- | src/fx.js | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -5,8 +5,10 @@ SVG.easing = { , '<': function(pos){return -Math.cos(pos * Math.PI / 2) + 1} } -SVG.morph = function(from, to) { - return new MorphObj(from, to).at(pos) +SVG.morph = function(pos){ + return function(from, to) { + return new SVG.MorphObj(from, to).at(pos) + } } SVG.Situation = SVG.invent({ @@ -409,7 +411,7 @@ SVG.FX = SVG.invent({ var c = this.last() , wrapper = function(e){ if(e.detail.situation == c){ - fn.call(this, e.detail.pos, SVG.morph, e.detail.eased, c) + fn.call(this, e.detail.pos, SVG.morph(e.detail.pos), e.detail.eased, c) } } @@ -436,7 +438,7 @@ SVG.FX = SVG.invent({ // calls on every animation step for all animations , duringAll: function(fn){ var wrapper = function(e){ - fn.call(this, e.detail.pos, SVG.morph, e.detail.eased, e.detail.situation) + fn.call(this, e.detail.pos, SVG.morph(e.detail.pos), e.detail.eased, e.detail.situation) } this.target().off('during.fx', wrapper).on('during.fx', wrapper) |