From dcddd9a84a63065bd45f2a143cf56748c5edb150 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 18 Sep 2019 12:37:38 -0400 Subject: [PATCH] os_wayland: transform pointer events by scale Fixes #37 --- ui/app/os_wayland.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/app/os_wayland.go b/ui/app/os_wayland.go index 47d5ba3c..6d883ce9 100644 --- a/ui/app/os_wayland.go +++ b/ui/app/os_wayland.go @@ -1032,7 +1032,10 @@ func (w *window) flushScroll() { func (w *window) onPointerMotion(x, y C.wl_fixed_t, t C.uint32_t) { w.flushScroll() - w.lastPos = f32.Point{X: fromFixed(x), Y: fromFixed(y)} + w.lastPos = f32.Point{ + X: fromFixed(x) * float32(w.scale), + Y: fromFixed(y) * float32(w.scale), + } w.w.event(pointer.Event{ Type: pointer.Move, Position: w.lastPos,