Jump to content
GreenSock

Praney Behl

Problem with skewY

Moderator Tag

Recommended Posts

I have been trying to work using the skewX and skewY properties.

For some reason skewY has been acting very strange, although skewX seems to work fine.

 

Here : 

See the Pen lkhFn by praneybehl (@praneybehl) on CodePen

 

Is this a bug?

 

Thanks,

Praney

See the Pen PwmYOz by MAW (@MAW) on CodePen

Link to comment
Share on other sites

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

Thanks Jack,

 

Works great now.

So would there be an update to include the TweenMax as it includes them all.

 

Thanks,

Praney

Link to comment
Share on other sites

Sure, here you go - but keep in mind that this isn't the final release of 1.11.8 - it's just a "preview" version. 

TweenMax_1.11.8_preview.zip

  • Like 1
Link to comment
Share on other sites

Sure Jack,

Thanks for the preview :)

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

Hi Gary  :)

 

are you sure that using the last version of GSAP !

pls check this out :

 

See the Pen PwmYOz by MAW (@MAW) on CodePen

 

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