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:
@@ -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
|
||||
|
||||
@@ -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