Fix flipper animation and angle calculation #150
Merged
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.
Checked with a slowed down flipper (reduced retractTime and extendTime)
to ensure the flipper position is correct even when not finished while
pressing the flipper control.
Here are videos of the slowed down flippers before and after the patch.
Before this patch, the flipper where always starting their animation from either fully down or fully up, causing glitches when pressing or releasing the flipper button while it is midway:
simplescreenrecorder-2022-08-08_22.10.36.mp4
There is also a weird behavior when losing focus, both flipper trigger:
simplescreenrecorder-2022-08-08_22.17.08.mp4
With this patch, here is the flipper and ball behavior:
simplescreenrecorder-2022-08-08_22.03.05.mp4
There is no more weird behavior, and the ball can't move through the flippers.
With the normal flipper speed this is barely visible, except the moving flippers when losing and regaining focus (this is what led me to find this issue), but this might cause unexpected behaviors when playing.