From da81720a001feb869213cd2701204e17cf3244bc Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 11 Oct 2022 14:13:38 +0200 Subject: [PATCH] Improve formatting --- crates/fj-window/src/run.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/fj-window/src/run.rs b/crates/fj-window/src/run.rs index b1168dd58..f67df4f41 100644 --- a/crates/fj-window/src/run.rs +++ b/crates/fj-window/src/run.rs @@ -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, } }