Skip to content

Commit

Permalink
Ran cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lynn-lumen committed Feb 5, 2024
1 parent 3f6091f commit 9a3009a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,18 @@ fn handle_winit_event(
let physical_position = DVec2::new(position.x, position.y);

let last_position = win.physical_cursor_position();
let delta =
last_position.map(|last_pos| (physical_position.as_vec2() - last_pos) / win.resolution.scale_factor());
let delta = last_position.map(|last_pos| {
(physical_position.as_vec2() - last_pos) / win.resolution.scale_factor()
});

win.set_physical_cursor_position(Some(physical_position));
let position =
(physical_position / win.resolution.scale_factor() as f64).as_vec2();
app.send_event(CursorMoved { window, position, delta });
app.send_event(CursorMoved {
window,
position,
delta,
});
}
WindowEvent::CursorEntered { .. } => {
app.send_event(CursorEntered { window });
Expand Down

0 comments on commit 9a3009a

Please sign in to comment.