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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user