From b0ca7491ace6f404c82607f59b22aaa3419ad0c0 Mon Sep 17 00:00:00 2001 From: Rémi Tétreault Date: Sat, 21 Apr 2018 16:38:29 -0400 Subject: Fix issue #847 Animating a path by calling .attr() now work --- src/fx.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/fx.js b/src/fx.js index 4f2a9a9..ea1c293 100644 --- a/src/fx.js +++ b/src/fx.js @@ -750,8 +750,13 @@ SVG.MorphObj = SVG.invent({ create: function(from, to){ // prepare color for morphing if(SVG.Color.isColor(to)) return new SVG.Color(from).morph(to) - // prepare value list for morphing - if(SVG.regex.delimiter.test(from)) return new SVG.Array(from).morph(to) + // check if we have a list of values + if(SVG.regex.delimiter.test(from)) { + // prepare path for morphing + if(SVG.regex.pathLetters.test(from)) return new SVG.PathArray(from).morph(to) + // prepare value list for morphing + else return new SVG.Array(from).morph(to) + } // prepare number for morphing if(SVG.regex.numberAndUnit.test(to)) return new SVG.Number(from).morph(to) -- cgit v1.2.3