From 409e2cd82f750d5f17895b631d301fa4b05927ad Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 6 Nov 2019 11:28:40 +0000 Subject: [PATCH] fix mouse wheel speed osx. --- native/Avalonia.Native/src/OSX/window.mm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/native/Avalonia.Native/src/OSX/window.mm b/native/Avalonia.Native/src/OSX/window.mm index 2a5acaea91..0e85332555 100644 --- a/native/Avalonia.Native/src/OSX/window.mm +++ b/native/Avalonia.Native/src/OSX/window.mm @@ -855,8 +855,15 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent if(type == Wheel) { - delta.X = [event scrollingDeltaX] / 50; - delta.Y = [event scrollingDeltaY] / 50; + auto speed = 5; + + if([event hasPreciseScrollingDeltas]) + { + speed = 50; + } + + delta.X = [event scrollingDeltaX] / speed; + delta.Y = [event scrollingDeltaY] / speed; if(delta.X == 0 && delta.Y == 0) {