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

Make shift-scroll do horizontal scrolling on all platforms (#1136)

Closes https://github.com/emilk/egui/issues/1135
This commit is contained in:
Emil Ernerfeldt
2022-01-21 10:48:44 +01:00
committed by GitHub
parent e4aa1e6e1a
commit a689b623a6
6 changed files with 21 additions and 4 deletions

View File

@@ -460,6 +460,12 @@ impl State {
// Treat as zoom instead:
let factor = (delta.y / 200.0).exp();
self.egui_input.events.push(egui::Event::Zoom(factor));
} else if self.egui_input.modifiers.shift {
// Treat as horizontal scrolling.
// Note: one Mac we already get horizontal scroll events when shift is down.
self.egui_input
.events
.push(egui::Event::Scroll(egui::vec2(delta.x + delta.y, 0.0)));
} else {
self.egui_input.events.push(egui::Event::Scroll(delta));
}