Skip to content

Commit

Permalink
better handling of line scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Jun 19, 2022
1 parent ffc0e98 commit d9e8239
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rgis-mouse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ fn mouse_scroll_system(
) {
let mut x = 0.;
for event in mouse_scroll_event_reader.iter() {
x += event.y;
let y_scroll_amount =
if let bevy::input::mouse::MouseScrollUnit::Line = event.unit {
event.y * 10.
} else {
event.y
};
x += y_scroll_amount;
}
if x != 0. {
zoom_camera_events.send(rgis_events::ZoomCameraEvent::new(x));
Expand Down

1 comment on commit d9e8239

@michaelkirk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Please sign in to comment.