Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYevgeny Makarov <jenkm>2020-12-11 19:28:56 +0300
committerHarley Acheson <harley.acheson@gmail.com>2020-12-11 19:28:56 +0300
commitf7069d71aae32ce8db3a3b541395a51c9ba5f7c5 (patch)
tree2b998b7fa156b587df91e61ff10a87617aa34666 /intern/ghost/intern/GHOST_SystemCocoa.mm
parentbadbf816b867ffeb5920a1575d0159ec516b2819 (diff)
Trackpad: Fix wrong scroll deltas on Retina
Scale Mac trackpad scrolling changes by pixel size of output device. Differential Revision: https://developer.blender.org/D9723 Reviewed by Brecht Van Lommel
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemCocoa.mm')
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm5
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index d5b8311349b..6ec6bc78d45 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -1730,13 +1730,14 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
}
window->clientToScreenIntern(mousePos.x, mousePos.y, x, y);
+ NSPoint delta = [[cocoawindow contentView] convertPointToBacking:NSMakePoint(dx, dy)];
pushEvent(new GHOST_EventTrackpad([event timestamp] * 1000,
window,
GHOST_kTrackpadEventScroll,
x,
y,
- dx,
- dy,
+ delta.x,
+ delta.y,
[event isDirectionInvertedFromDevice]));
}
} break;