Jump to content
Search Community

'skewType' question

green_machine test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

When skewing an object, the 'skewType' parameter by default compensates for the distortion that occurs in a simple skew. So if you skew a 50px square, the height becomes smaller the more it is skewed. 

 

Is there an easy way to get the square's new "height" as it's being skewed? Trying to determine if that's the easier task vs using a simple skew and adding my own compensation to the skewed object. 

 

Thanks!

Link to comment
Share on other sites

getBoundingClientRect() should indeed work, but it'd probably be more performant to maybe just do the raw math instead (like Triginometry/Geometry or whatever category this falls under ? ). Can you help us understand the context a bit? Do you have a codepen? 

  • Like 2
Link to comment
Share on other sites

Duh, getBoundingClientRect totally will work. I haven't started making anything yet, was just a question that popped into my head and I made it more complicated than it needed to be. Was thinking there would be a _gsTransform.theRealHeight undocumented property or something. Thanks, everyone!

  • Like 2
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...