horizontal scrolling with shift

This commit is contained in:
2025-11-18 14:32:46 -05:00
parent 01cd02c0f9
commit 288dc1882c

View File

@@ -33,10 +33,14 @@ impl Input {
} }
} }
WindowEvent::MouseWheel { delta, .. } => { WindowEvent::MouseWheel { delta, .. } => {
let delta = match *delta { let mut delta = match *delta {
MouseScrollDelta::LineDelta(x, y) => Vec2::new(x, y), MouseScrollDelta::LineDelta(x, y) => Vec2::new(x, y),
MouseScrollDelta::PixelDelta(pos) => Vec2::new(pos.x as f32, pos.y as f32), MouseScrollDelta::PixelDelta(pos) => Vec2::new(pos.x as f32, pos.y as f32),
}; };
if delta.x == 0.0 && self.modifiers.shift {
delta.x = delta.y;
delta.y = 0.0;
}
self.cursor.scroll_delta = delta; self.cursor.scroll_delta = delta;
} }
WindowEvent::CursorLeft { .. } => { WindowEvent::CursorLeft { .. } => {