three-stdlib
three-stdlib copied to clipboard
Quick bugfix to Flycontrols
First, I'll 100% admit I don't fully understand this code (apologies). However, repeated bug under use of Flycontrols with dragToLook = true, that it would get "stuck" as if the mouse was always down. This happened with some condition where mouseStatus ended up > 1 and never got back to 0.
This two line fix seems to fix it. Been testing it locally and works well.
Feedback welcome!
Why
Small but very annoying bug in Flycontrols where after extensive use, the mouse gets "stuck" as if down. This only happens with dragToLook=true.
Note - feeling like a dolt but could not find CONTRIBUTING.md!
What
Two line fix - rather than increment/decrement mouseStatus, just set to 0 or 1. This avoids mouseStatus becoming > 1 and then never decrementing back to 0.
Checklist
- [x] Documentation updated - N/A - its a bug
- [x] Storybook entry added - N/A - its a bug
- [x] Ready to be merged - Given I don't know this code would like a review before saying ready to be merged.
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
@CodyJasonBennett Sorry for the random ping but I was hoping you could let me know how to get someone to take a look at this PR (saw you were in this repo not so long ago).