-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix signed/unsigned arithmetic bug during scrolling (#13256)
ed27737 contains a regression where (pseudocode) ```c unsigned long ulActualDelta; short ScreenInfo.WheelDelta; delta *= (ScreenInfo.WheelDelta / (short)ulActualDelta); // ^^^^^^^ ``` was changed to ```c delta *= (ScreenInfo.WheelDelta / ulActualDelta); ``` Due to `ulActualDelta` being unsigned, the new code casts the signed integer to a unsigned one first, before doing the division. This causes scrolling downwards (`WheelDelta` is negative) to appear as a large positive `delta`. ## PR Checklist * [x] Closes #13253 * [x] I work here ## Validation Steps Performed * Scrolling up/down works in OpenConsole again ✅
- Loading branch information
Showing
2 changed files
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters