Jump to content
Search Community

shortRotation not working for <canvas> element

mikebikeboy 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

Hi everyone, I'm new here so thanks in advance for any communal help I receive.  :-P

 

I have a canvas element I'm rotating onMouseMove. Here's the example:

 

http://mikewatt.info/dev/html5_tests/wheel/wheel.html

 

My problem is that 'shortRotation' is not working. Right now I'm using simply 'rotation' because it's working and illustrates the problem area I'm having. If you click the mouse down and drag over the horizontal middle of the circle on the right hemisphere, you'll see the wheel jump 360 degrees to come back to where your mouse is. That's where I need 'shortRotation' but it's not working.

 

Anybody know why?

 

Thanks in advance,

 

mikebikeboy

Link to comment
Share on other sites

The problem was that there was no ShortRotationPlugin available - the shortRotation functionality that was in GSAP was only inside CSSPlugin (thus only worked for DOM elements). You were tweening a generic object that's not a DOM element, so it wasn't kicking in. However, I've attached a new ShortRotationPlugin that you can load and then it should work just fine. Let us know if it works okay for you. 

ShortRotationPlugin.js.zip

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