diff options
author | 2024-04-26 01:44:03 +0200 | |
---|---|---|
committer | 2024-04-26 01:44:03 +0200 | |
commit | 6d4155a5488da5b7fa3fd314f98c8f28c7202bd4 (patch) | |
tree | accc4e3c28c7a3b260e049ff7356fe91ca6dda43 /widget | |
parent | eb49567791015be7f329d7d57d5f8c388abecd96 (diff) | |
download | iced-6d4155a5488da5b7fa3fd314f98c8f28c7202bd4.tar.gz iced-6d4155a5488da5b7fa3fd314f98c8f28c7202bd4.tar.bz2 iced-6d4155a5488da5b7fa3fd314f98c8f28c7202bd4.zip |
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?
Diffstat (limited to 'widget')
-rw-r--r-- | widget/src/scrollable.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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) |