1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -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

@@ -6,6 +6,7 @@ All notable changes to the `egui-winit` integration will be noted in this file.
## Unreleased
* Fix horizontal scrolling direction on Linux.
* Replaced `std::time::Instant` with `instant::Instant` for WebAssembly compatability ([#1023](https://github.com/emilk/egui/pull/1023))
* Shift-scroll will now result in horizontal scrolling on all platforms ((#1136)[https://github.com/emilk/egui/pull/1136]).
## 0.16.0 - 2021-12-29

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));
}