Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to animate scale when scaleX and scaleY are different? #18

Open
rafaelbuiu opened this issue Jul 16, 2017 · 1 comment
Open

How to animate scale when scaleX and scaleY are different? #18

rafaelbuiu opened this issue Jul 16, 2017 · 1 comment

Comments

@rafaelbuiu
Copy link

rafaelbuiu commented Jul 16, 2017

Trying to animate the size of a rectangle shape based on width and height, but I can't see how to do it with paper-animate.

I already have the values for scaleX and scaleY. They work fine when scaling using the function of PaperJS, but it's not animated.

function resize(elem,width,height){
   var scaleX = width/elem.bounds.width;
   var scaleY = height/elem.bounds.height;
   elem.scale(scaleX,scaleY); 
}

Is the a way to use something like:

this.animate({
 properties: {
  scale: {
    x: 2.554
    y: 1.443
   }
  },
  settings: {
   duration: 400
  }
 });

Thanks guys.

@camille-hdl
Copy link
Owner

camille-hdl commented Jul 20, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants