mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Replace scroll_delta and zoom_delta in RawInput with events
Part of https://github.com/emilk/egui/issues/843
This commit is contained in:
@@ -461,9 +461,10 @@ impl State {
|
||||
|
||||
if self.egui_input.modifiers.ctrl || self.egui_input.modifiers.command {
|
||||
// Treat as zoom instead:
|
||||
self.egui_input.zoom_delta *= (delta.y / 200.0).exp();
|
||||
let factor = (delta.y / 200.0).exp();
|
||||
self.egui_input.events.push(egui::Event::Zoom(factor));
|
||||
} else {
|
||||
self.egui_input.scroll_delta += delta;
|
||||
self.egui_input.events.push(egui::Event::Scroll(delta));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user