Jump to content
Search Community

quickTo() doesn't seem to read a scale value

Michaël Garcia test
Moderator Tag

Recommended Posts

I'm setting a simple quickTo() function. 
I noticed a weird behaviour when I try to use it with a scale value: 

 

// NOT WORKING
const scaleTo = gsap.quickTo('.shape', "scale", {
    duration: 1, 
    ease: "power3"
})

This code doesn't work and returns an error: "RangeError: Maximum call stack size exceeded".
But as soon as I replace my scale attribute by scaleX for example it works normally: 

 

// WORKING
const scaleTo = gsap.quickTo('.shape', "scaleX", {
    duration: 1, 
    ease: "power3"
})

Is there a way to make a quickTo() function work with a simple scale value ? Or am I forced to declare two quickTo() to play with both the scaleX & scaleY instead ? Thank you very much

 

Link to comment
Share on other sites

You should animate scaleX and scaleY rather than scale (which is like an alias for combining scaleX and scaleY) because under the hood, those are independent. See the docs: 

https://greensock.com/docs/v3/GSAP/gsap.quickTo()

 

This is part of how we were able to optimize things so much (skipping alias properties). It's like piping values directly into the individual slots. 

 

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...