1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

egui_glium: Flip vertical scroll direction on Linux

This is to address https://github.com/emilk/egui/issues/356
This commit is contained in:
Emil Ernerfeldt
2021-05-08 08:35:17 +02:00
parent cb797a489a
commit be44c71e31

View File

@@ -177,11 +177,16 @@ pub fn input_to_egui(
vec2(delta.x as f32, delta.y as f32) / pixels_per_point 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") { if cfg!(target_os = "macos") {
// This is still buggy in winit despite // This is still buggy in winit despite
// https://github.com/rust-windowing/winit/issues/1695 being closed // https://github.com/rust-windowing/winit/issues/1695 being closed
delta.x *= -1.0; delta.x *= -1.0;
} }
if cfg!(target_os = "linux") {
delta.y *= -1.0;
}
if input_state.raw.modifiers.ctrl { if input_state.raw.modifiers.ctrl {
// Treat as zoom instead: // Treat as zoom instead: