aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRémi Tétreault <tetreault.remi@gmail.com>2018-04-21 16:38:29 -0400
committerRémi Tétreault <tetreault.remi@gmail.com>2018-04-21 16:40:35 -0400
commitb0ca7491ace6f404c82607f59b22aaa3419ad0c0 (patch)
tree1d0767962c1aba2643c865320741c131a510bc5c /src
parente4281c8d426404306b6df950531dca4c8c994c61 (diff)
downloadsvg.js-b0ca7491ace6f404c82607f59b22aaa3419ad0c0.tar.gz
svg.js-b0ca7491ace6f404c82607f59b22aaa3419ad0c0.zip
Fix issue #847
Animating a path by calling .attr() now work
Diffstat (limited to 'src')
-rw-r--r--src/fx.js9
1 files changed, 7 insertions, 2 deletions
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)