ui/app: (macOS) use a consistent and constant backing store constant

Compute and keep constant the pixel density, to avoid window content
changes when moving to another monitor with a different density.

Use backing store scale, not content scale for input events.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-21 16:53:44 +02:00
parent cb59594b5b
commit 8eea6b80f3
4 changed files with 43 additions and 21 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
static void handleMouse(NSView *view, NSEvent *event, int typ, CGFloat dx, CGFloat dy) {
NSPoint p = [view convertPoint:[event locationInWindow] fromView:nil];
CGFloat scale = view.layer.contentsScale;
CGFloat scale = view.window.backingScaleFactor;
if (!event.hasPreciseScrollingDeltas) {
// dx and dy are in rows and columns.
dx *= 10;