Jump to content
Search Community

Problem with skewY

Praney Behl 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

Yes indeed. skewY is a tricky one because technically it's a phantom value. To optimize performance, GSAP combines all skewing into the skewX and rotation values (skewY is simply a rotation with the opposite skewX). In other words, visually skewY:30 is the same as rotation:30, skewX:30. The matrix math is faster when we handle it that way instead of trying to manage an extra variable. So keep that in mind when you're analyzing the _gsTransform data. There was a bug that caused the engine not to record the skewY value properly, so each time you skewed to a new value, it was acting as though skewY was 0 (but it had already been applied to skewX and rotation).

 

I've attached a preview version of CSSPlugin 1.11.8 with a fix in place. Does that work well for you? 

CSSPlugin_1.11.8_preview.zip

  • Like 2
Link to comment
Share on other sites

  • 8 months later...

I just ran into this.  I had set skewY on an object and later rotated it 360 degrees.  I expected, after the rotation, it would look exactly the same as before the rotation but instead looked like a skewX.  It makes sense that skewY is a phantom value for performance, but this was a head-scratcher.  

 

Perhaps if rotationZ was added to the rotation of skewY instead of replacing it, that would be more obvious.  That might require an extra variable in _gsTransform, though, which is not optimal.

Link to comment
Share on other sites

To be clear, I'm not necessarily suggesting that this should be "fixed." It works fine as implemented.  A user can just manually add the extra rotation.  I'm just pointing out that I ran into the same confusion that the original poster did.  Maybe my comments will help anyone else wondering why skewY turns into skewX.

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...