问题
Right now I'm using:
r.forEach(
function (el) {
el.scale(0.5, 0.5, 0.0, 0.0);
});
to scale each object around (0/0), which is working fine.
The Raphael reference however states that the scale function is deprecated and I'm supposed to use Raphael.transform(...) instead.
I tried:
r.forEach(
function (el) {
el.transform("S(0.5)");
});
however, this will scale the paths using the image center as the center of scale. How can I achieve the same effect with the transform function?
回答1:
You can use translation string the same way as parameters of "scale" function:
el.transform("s0.5, 0.5, 0, 0");
回答2:
el.transform("S0.5, 0.5, 0, 0");
solved here
来源:https://stackoverflow.com/questions/9867975/raphael-center-of-scale-in-transform-method