zarocknz/javascript-winwheel

resetWheel examples change the rotation of the wheel to zero degrees

Closed this issue · 1 comments

In many of the examples, when you press the "Reset wheel" button, this occurs:

theWheel.rotationAngle = 0;

Which unfortunately looks bad, as the wheel resets to its original rotation.

In order to maintain the current position of the wheel when reset, instead of changing the rotation value to "0", it should be like this instead:

theWheel.rotationAngle = theWheel.rotationAngle % 360;

This should allow it to continue animating properly, while maintaining the current rotation.

Thanks, yes it works great.

I have updated one of the tutorials to mention this as a Tip, and may update an example to show it in use as well.

Cheers,
DouG.