Jump to content
GreenSock

jivory

Rotation values with negative scale

Recommended Posts

I'm having an issue with rotation values the flex transform manager is giving me.

I add an item to the manager, and in a TransformEvent.ROTATE event, I'm tracing out the item's rotation, $e.items[0].rotation.

 

When the object has a positive scale on both x and y, it gives me a full 360 degree value. 0 -- 90/91 -- 180/-180 -- -90/-89 -- 0. 0 to 180 and back to 0.

If I scale the item negative, either x or y, then rotate it gives me different rotation values. 0 -- 90/-90 -- 0/-1 -- -90/-89 -- 0. 0 to 90, to 0, to 90, then back to 0. So it says 0 and 180 degrees are both 0. Is this correct?

The object rotates great, but the values it's telling me don't seem right.

I built an HSlider to help rotate the object and it is giving me wrong values so the slider does not work properly.

 

Anyone seen this issue or how to resolve it?

Thanks

Link to comment
Share on other sites

Explaining the way Flash reports rotation values especially when objects have negative scales is a pretty complex. I'll look into this further, but in the mean time, I'd recommend simply using the targetObject's rotation value instead of the TransformItem's. So your code would be $e.items[0].targetObject.rotation instead of $e.items[0].rotation. Just make sure you call update() on the associated TransformItem to ensure that it stays synchronized. Again, I'll continue to look into the issue and post back here if/when I find any new info.

Link to comment
Share on other sites

That works. Tracing the items toargetObject instead gives me the full rotation.

Not sure why the item itself is throwing different values, but that solves my issue, thanks

Link to comment
Share on other sites

I just posted version 1.92 which I fixes the rotation reporting issue. Please snag the latest version from your GreenSock account at http://www.greensock.com/account/ and let me know if it works well for you. I also added new minWidth, maxWidth, minHeight, and maxHeight properties to TransformItem.

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