Improve formatting

This commit is contained in:
Hanno Braun 2022-10-11 14:13:38 +02:00
parent 70b446fb07
commit da81720a00

View File

@ -264,12 +264,18 @@ fn input_event(
Event::WindowEvent {
event: WindowEvent::MouseWheel { delta, .. },
..
} => Some(input::Event::Zoom(match delta {
MouseScrollDelta::LineDelta(_, y) => (*y as f64) * ZOOM_FACTOR_LINE,
MouseScrollDelta::PixelDelta(PhysicalPosition { y, .. }) => {
y * ZOOM_FACTOR_PIXEL
}
})),
} => {
let delta = match delta {
MouseScrollDelta::LineDelta(_, y) => {
(*y as f64) * ZOOM_FACTOR_LINE
}
MouseScrollDelta::PixelDelta(PhysicalPosition {
y, ..
}) => y * ZOOM_FACTOR_PIXEL,
};
Some(input::Event::Zoom(delta))
}
_ => None,
}
}