Created
January 29, 2026 12:49
-
-
Save TheBlckbird/eba1fa02543bd9eb19e33c825be4ebbf to your computer and use it in GitHub Desktop.
SDL3 patch to fix scrolling on MacOS in Terraria
This file contains hidden or 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
| diff -u a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m | |
| --- a/src/video/cocoa/SDL_cocoamouse.m 2025-11-20 13:51:22 | |
| +++ b/src/video/cocoa/SDL_cocoamouse.m 2026-01-29 13:40:03 | |
| @@ -615,8 +615,22 @@ | |
| SDL_MouseWheelDirection direction; | |
| CGFloat x, y; | |
| - x = -[event scrollingDeltaX]; | |
| - y = [event scrollingDeltaY]; | |
| + // x = -[event scrollingDeltaX]; | |
| + // y = [event scrollingDeltaY]; | |
| + | |
| + | |
| + if ([event scrollingDeltaX] < 0) { | |
| + x = 1; | |
| + } else { | |
| + x = -1; | |
| + } | |
| + | |
| + if ([event scrollingDeltaY] < 0) { | |
| + y = -1; | |
| + } else { | |
| + y = 1; | |
| + } | |
| + | |
| direction = SDL_MOUSEWHEEL_NORMAL; | |
| if ([event isDirectionInvertedFromDevice] == YES) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment