Transform matrix in Raphael.js
I'm looking to apply a 2D affine transform matrix to ellipses I have created in Raphael. I understand that the underlying SVG can support this, but does Ra开发者_如何学Pythonphael provide a way to access this?
newShape = paper.ellipse(100, 200, 50, 150);
// apply transform here
I have tried parsing transform matrices myself, working out rotation, scaling and translation manually and applying in Raphael, but it didn't seem to work and I thought there must be a better way?
Many thanks, Will.
The beta for Raphael.js 2.0 came out last week--
https://github.com/DmitryBaranovskiy/raphael/tree/2.0
There is a new 'transform' method that seems to be just what you're looking for.
Brian
精彩评论