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?
This commit is contained in:
Héctor Ramón Jiménez 2024-04-26 01:44:03 +02:00
parent eb49567791
commit 6d4155a548
No known key found for this signature in database
GPG key ID: 4C07CEC81AFA161F

View file

@ -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)