我想要动画显示一个三角形(例如:角度计的指针),使其绕给定点旋转(请见红点)。
var svg = Raphael("container",400,400),
triangle = svg.path("M210 200L190 200L200 100Z").attr({fill:"#000"}),
circle = svg.circle(200,200,5).attr({fill:"#f00"});
// to animate ??
triangle.animate({rotation:100,cx:200,cy:200},1000,'<>');
// doesn't work
我可以沿着那个中心旋转(无需动画):
// to rotate with center point 200,200, works fine
triangle.rotate(80,200,200);
但是我始终弄不清楚如何使旋转动画围绕该点旋转。它似乎总是在路径的中心旋转。
需要帮助吗?