diff options
Diffstat (limited to 'dist/svg.js')
-rw-r--r-- | dist/svg.js | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/dist/svg.js b/dist/svg.js index 2ff7761..eec3f7b 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens <wout@mick-wout.com> * @license MIT * -* BUILT: Mon May 01 2017 20:27:59 GMT-0400 (EDT) +* BUILT: Tue May 02 2017 21:48:32 GMT-0400 (EDT) */; (function(root, factory) { /* istanbul ignore next */ @@ -1502,7 +1502,7 @@ SVG.FX = SVG.invent({ // updates all animations to the current state of the element // this is important when one property could be changed from another property , initAnimations: function() { - var i, source + var i, j, source var s = this.situation if(s.init) return this @@ -1510,12 +1510,26 @@ SVG.FX = SVG.invent({ for(i in s.animations){ source = this.target()[i]() - // The condition is because some methods return a normal number instead - // of a SVG.Number - if(s.animations[i] instanceof SVG.Number) - source = new SVG.Number(source) + if(!Array.isArray(source)) { + source = [source] + } + + if(!Array.isArray(s.animations[i])) { + s.animations[i] = [s.animations[i]] + } - s.animations[i] = source.morph(s.animations[i]) + //if(s.animations[i].length > source.length) { + // source.concat = source.concat(s.animations[i].slice(source.length, s.animations[i].length)) + //} + + for(j = source.length; j--;) { + // The condition is because some methods return a normal number instead + // of a SVG.Number + if(s.animations[i][j] instanceof SVG.Number) + source[j] = new SVG.Number(source[j]) + + s.animations[i][j] = source[j].morph(s.animations[i][j]) + } } for(i in s.attrs){ @@ -2133,9 +2147,13 @@ SVG.extend(SVG.FX, { return this } // Add animatable plot -, plot: function() { - // We use arguments here since SVG.Line's plot method can be passed 4 parameters - return this.add('plot', arguments.length > 1 ? [].slice.call(arguments) : arguments[0]) +, plot: function(a, b, c, d) { + // Lines can be plotted with 4 arguments + if(arguments.length == 4) { + return this.plot([a, b, c, d]) + } + + return this.add('plot', new (this.target().morphArray)(a)) } // Add leading method , leading: function(value) { @@ -2342,7 +2360,7 @@ SVG.RBox.prototype.constructor = SVG.RBox SVG.Matrix = SVG.invent({ // Initialize create: function(source) { - var i, base = arrayToMatrix([1, 0, 0, 1, 0, 0]), n + var i, base = arrayToMatrix([1, 0, 0, 1, 0, 0]) // ensure source as object source = source instanceof SVG.Element ? @@ -2357,12 +2375,9 @@ SVG.Matrix = SVG.invent({ source : base // merge source - for (i = abcdef.length - 1; i >= 0; --i) { - n = source[abcdef[i]] - if(n != null) n = n.valueOf() - - this[abcdef[i]] = typeof n === 'number' ? n : base[abcdef[i]] - } + for (i = abcdef.length - 1; i >= 0; --i) + this[abcdef[i]] = source[abcdef[i]] != null ? + source[abcdef[i]] : base[abcdef[i]] } // Add methods @@ -4753,8 +4768,9 @@ SVG.TextPath = SVG.invent({ // Add parent method , construct: { + morphArray: SVG.PathArray // Create path for text to run on - path: function(d) { + , path: function(d) { // create textPath element var path = new SVG.TextPath , track = this.doc().defs().path(d) |