From 94673a482e8c0420d56ced9afec6cf312b1273a8 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sun, 19 Nov 2023 17:58:44 -0800 Subject: [PATCH] Convert pixel scroll deltas into logical units Winit supplies these in physical coordinates. --- crates/yakui-winit/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/yakui-winit/src/lib.rs b/crates/yakui-winit/src/lib.rs index 058d7f61..706ba458 100644 --- a/crates/yakui-winit/src/lib.rs +++ b/crates/yakui-winit/src/lib.rs @@ -139,6 +139,7 @@ impl YakuiWinit { MouseScrollDelta::LineDelta(x, y) => Vec2::new(x, y) * LINE_HEIGHT, MouseScrollDelta::PixelDelta(offset) => { Vec2::new(offset.x as f32, offset.y as f32) + / state.layout_dom().scale_factor() } };