Skip to content

Commit

Permalink
Fix Shift scrolling for scrollable on macOS
Browse files Browse the repository at this point in the history
Apparently, macOS inverts the scrolling axes automatically now.
Was this a thing before, or did an update just break user space?
  • Loading branch information
hecrj committed Apr 25, 2024
1 parent eb49567 commit 6d4155a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion widget/src/scrollable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6d4155a

Please sign in to comment.