scp-fs2open / scp-fs2open/fs2open.github.com
mousewheel_decay() stinks
- Dominant language
- C++
- Stars
- 487
- Forks
- 184
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 44
Description
Intentional pun is intentional. 😜
The design of the mousewheel's increment and decay to zero is bad, from a maintainer aspect. Evocation of `mousewheel_decay()` should only ever be called once per frame, but the current implementation allows it to be called multiple times a frame, running the risk of unintended fast decay.
`mousewheel_decay()` is also called only from within mouse_down() for some reason, possibly due to a UI design quirk. Intuitively, the function that deals with modifying a counter variable should be grouped with a like function `mouse_down_count()`.
Note: both `joy_down_count()` and `mouse_down_count()` appear to share the same vulnerability at first glance, but its design is done so that the counter may be reset to zero at first call, making subsequent calls return 0 and prevent further actions that could show buggy behavior.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.