javascript - Raphael center of scale in transform method - Stack Overflow

Right now I'm using:r.forEach(function (el) {el.scale(0.5, 0.5, 0.0, 0.0);});to scale each object

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 badges
Add a ment  | 

2 Answers 2

Reset to default 5

You 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744401188a4572395.html

相关推荐

  • javascript - Raphael center of scale in transform method - Stack Overflow

    Right now I'm using:r.forEach(function (el) {el.scale(0.5, 0.5, 0.0, 0.0);});to scale each object

    6天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信