/// Processes camera events coming from the mouse wheel.
Processes camera events coming from the mouse wheel.
Processes camera events coming from the mouse wheel .
fn cam_events_from_wheel(
        mut mouse_wheel: EventReader<'_, '_, MouseWheel>,
        scale: f32,
        cam_inputs: &mut EventWriter<'_, '_, Self>,
    ) {
        for MouseWheel { unit, y, .. } in mouse_wheel.iter() {
            let unit_scale = match unit {
                MouseScrollUnit::Line => 12.0,
                MouseScrollUnit::Pixel => 1.0,
            };
            cam_inputs.send(Self::Zoom(unit_scale * -scale * y))
        }
    }
fn cam_events_from_wheel ( mut mouse_wheel : EventReader < ' _ , ' _ , MouseWheel > , scale : f32 , cam_inputs : & mut EventWriter < ' _ , ' _ , Self > , ) { for MouseWheel { unit , y , .. } in mouse_wheel . iter ( ) { let unit_scale = match unit { MouseScrollUnit :: Line => 12.0 , MouseScrollUnit :: Pixel => 1.0 , } ; cam_inputs . send ( Self :: Zoom ( unit_scale * - scale * y ) ) } }
Processes camera events coming from the mouse wheel.
Processes camera events coming from the mouse wheel .
mouse_wheel
EventReader<'_, '_, MouseWheel>
scale
f32
cam_inputs
&mut EventWriter<'_, '_, Self>