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?
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?
Share Improve this question asked Mar 26, 2012 at 7:07 triggerfishtriggerfish 431 silver badge3 bronze badges2 Answers
Reset to default 5You can use translation string the same way as parameters of "scale" function:
el.transform("s0.5, 0.5, 0, 0");
el.transform("S0.5, 0.5, 0, 0");
solved here