Raphael.js 中的变换矩阵
我希望将 2D 仿射变换矩阵应用于我在 Raphael 中创建的椭圆。我知道底层 SVG 可以支持这一点,但是 Raphael 是否提供了一种访问它的方法?
newShape = paper.ellipse(100, 200, 50, 150);
// apply transform here
我尝试过自己解析变换矩阵,手动计算旋转、缩放和平移并在 Raphael 中应用,但它似乎不起作用,我想一定有更好的方法吗?
非常感谢, 将要。
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 Raphael 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Raphael.js 2.0 的测试版于上周发布 -
https://github.com/DmitryBaranovskiy/ raphael/tree/2.0
有一种新的“转换”方法似乎正是您正在寻找的。
布莱恩
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