|
|
@@ -618,17 +618,18 @@ void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event)
|
|
|
SDL_MouseWheelDirection direction;
|
|
|
CGFloat x, y;
|
|
|
|
|
|
- x = -[event deltaX];
|
|
|
- y = [event deltaY];
|
|
|
direction = SDL_MOUSEWHEEL_NORMAL;
|
|
|
|
|
|
if ([event isDirectionInvertedFromDevice] == YES) {
|
|
|
direction = SDL_MOUSEWHEEL_FLIPPED;
|
|
|
}
|
|
|
|
|
|
- /* For discrete scroll events from conventional mice, always send a full tick.
|
|
|
- For continuous scroll events from trackpads, send fractional deltas for smoother scrolling. */
|
|
|
- if (![event hasPreciseScrollingDeltas]) {
|
|
|
+ if ([event hasPreciseScrollingDeltas]) {
|
|
|
+ x = -[event scrollingDeltaX] * 0.1f;
|
|
|
+ y = [event scrollingDeltaY] * 0.1f;
|
|
|
+ } else {
|
|
|
+ x = -[event deltaX];
|
|
|
+ y = [event deltaY];
|
|
|
if (x > 0) {
|
|
|
x = SDL_ceil(x);
|
|
|
} else if (x < 0) {
|