Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation fixes #13

Merged
merged 3 commits into from
Oct 20, 2016
Merged

Animation fixes #13

merged 3 commits into from
Oct 20, 2016

Conversation

zarocknz
Copy link
Owner

@zarocknz zarocknz commented Oct 20, 2016

Fixes #12 by taking in to account the wheel's pointerAngle when the stopAngle of the animation is specified using the getRandomForSegment() function or manually. The correct segment will now be displayed when the pointerAngle is something other than the default of 0 and the stopAngle has been specified.

While looking at this discovered an issue with GSAP's (the animation library used) ticker not calling the animationLoop() function which re-draws the wheel at the end of the animation for some easing types and/or if the duration was quite short. The animation was reported as ended without the last frame showing the final state of the wheel being drawn. Fixed this by doing away with hooking in to the ticker and instead getting onUpdate of the animation to call the animationLoop function.

Also fixes #8 where an error would be thrown if stopAnimation() was called before the animation had run for the first time by checking that a variable was set before trying to use it.

Fixed an issue where the wheel's pointerAngle was not being used when
the stopAngle was specified so wrong segment was displayed as the winner
when the pointerAngle was not the default of 0.
Fixed error in stopAnimation when animation has not run before.
@zarocknz zarocknz merged commit 1496270 into master Oct 20, 2016
@zarocknz zarocknz deleted the animation-fixes branch January 4, 2017 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting the Prize to be won before spinning Calling stop animation errors unless animation has run before
1 participant