Skip to content

Commit

Permalink
Removed Event::Scroll and Event::Zoom support as per egui v0.28 changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArjunNair committed Sep 16, 2024
1 parent 93e58fb commit 2edaef2
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,11 @@ pub fn input_to_egui(

MouseWheel { x, y, .. } => {
let delta = vec2(x as f32 * 8.0, y as f32 * 8.0);
let sdl = window.subsystem().sdl();
if sdl.keyboard().mod_state() & Mod::LCTRLMOD == Mod::LCTRLMOD
|| sdl.keyboard().mod_state() & Mod::RCTRLMOD == Mod::RCTRLMOD
{
state
.input
.events
.push(Event::Zoom((delta.y / 125.0).exp()));
} else {
state.input.events.push(Event::Scroll(delta));
}
state.input.events.push(Event::MouseWheel {
unit: MouseWheelUnit::Point,
delta,
modifiers: state.modifiers,
});
}

_ => {
Expand Down

0 comments on commit 2edaef2

Please sign in to comment.