From 6d4155a5488da5b7fa3fd314f98c8f28c7202bd4 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 26 Apr 2024 01:44:03 +0200 Subject: Fix `Shift` scrolling for `scrollable` on macOS Apparently, macOS inverts the scrolling axes automatically now. Was this a thing before, or did an update just break user space? --- widget/src/scrollable.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'widget') diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index f0a042cd..6fc00f87 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -564,7 +564,9 @@ where let delta = match delta { mouse::ScrollDelta::Lines { x, y } => { // TODO: Configurable speed/friction (?) - let movement = if state.keyboard_modifiers.shift() { + let movement = if !cfg!(target_os = "macos") // macOS automatically inverts the axes when Shift is pressed + && state.keyboard_modifiers.shift() + { Vector::new(y, x) } else { Vector::new(x, y) -- cgit