Skip to content

Commit

Permalink
egui_glium: Flip vertical scroll direction on Linux
Browse files Browse the repository at this point in the history
This is to address #356
  • Loading branch information
emilk committed May 8, 2021
1 parent cb797a4 commit be44c71
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions egui_glium/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,16 @@ pub fn input_to_egui(
vec2(delta.x as f32, delta.y as f32) / pixels_per_point
}
};

// Various hacks for https://github.com/emilk/egui/issues/356
if cfg!(target_os = "macos") {
// This is still buggy in winit despite
// https://github.com/rust-windowing/winit/issues/1695 being closed
delta.x *= -1.0;
}
if cfg!(target_os = "linux") {
delta.y *= -1.0;
}

if input_state.raw.modifiers.ctrl {
// Treat as zoom instead:
Expand Down

0 comments on commit be44c71

Please sign in to comment.