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
c.done = dt == Infinity
if(dt == Infinity) return target
if(dt == 0) return current
+
+ if (dt > 100) dt = 16
+
dt /= 1000
// Get the previous velocity
}
}
- SVG.Matrix.call(this, obj)
+ var data = {...(obj || {})}
- if (obj && obj.origin) {
- obj.originX = obj.origin[0]
- obj.originY = obj.origin[1]
+ if (typeof data.origin == 'string') {
+ delete data.origin
}
- this.originX = obj && obj.originX || 0
- this.originY = obj && obj.originY || 0
+ SVG.Matrix.call(this, data)
+
+
+ if (data.origin) {
+ data.originX = data.origin[0]
+ data.originY = data.origin[1]
+ }
+
+ this.originX = data.originX || 0
+ this.originY = data.originY || 0
},
extend: {