Reputation: 243
I have an animation where several paths are transformed in the same way. I would like to make it more efficient by greating a single compound path and applying the transformation only once. The problem is that the paths are a different color. Using a set or array will not help because it is not more efficient than using seperate paths. How do I do this?
For a set paper.set( paper.path('M0,0 4,0 0,4z'),paper.path('M9,9 4,9 9,4z') );, an equivalent compound path would be paper.path('M0,0 4,0 0,4z M9,9 4,9 9,4z');.
Upvotes: 0
Views: 142
Reputation: 3488
Try Snap.svg. It was built on the same engine of Raphael by dimitri (the guy who created rephael). It supports grouping which will give you what you are looking for. The migration from Raphael to Snap.svg is very simple and almost requires no modification.
Upvotes: 1