From ee25f92f87f2fc5bb6ab65023c4515a285535ff4 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 4 Jul 2018 18:27:00 +0200 Subject: make TransformBag clone the object before altering --- dirty.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'dirty.html') diff --git a/dirty.html b/dirty.html index 896449b..df7c871 100644 --- a/dirty.html +++ b/dirty.html @@ -275,12 +275,15 @@ let obj = { rotate: 180, origin: 'center', translate: [300, 0] } let obj2 = { rotate: 360, origin: 'center' } a.clone() // startPosition -a.clone().transform(obj, true).transform(obj2, true) // endPosition +//a.clone().transform(obj, true).transform(obj2, true) // endPosition // that works a.animate(new SVG.Spring(50, 30)).transform(obj) // animation // that breaks (why??) -// a.clone().animate(new SVG.Spring(50, 30)).transform(obj) // animation + +var b = a.clone().animate(new SVG.Spring(500, 30)) +//debugger +b.transform(obj) // animation //a.animate(300).transform(obj, true).transform(obj2, true) // animation -- cgit v1.2.3