Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.