aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/input.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/input.rs b/src/input.rs
index a48a299a..80000efe 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -1078,15 +1078,18 @@ impl State {
fn on_pointer_axis<I: InputBackend>(&mut self, event: I::PointerAxisEvent) {
let source = event.source();
- let horizontal_amount = event
- .amount(Axis::Horizontal)
- .unwrap_or_else(|| event.amount_v120(Axis::Horizontal).unwrap_or(0.0) * 3.0 / 120.);
- let vertical_amount = event
- .amount(Axis::Vertical)
- .unwrap_or_else(|| event.amount_v120(Axis::Vertical).unwrap_or(0.0) * 3.0 / 120.);
let horizontal_amount_v120 = event.amount_v120(Axis::Horizontal);
let vertical_amount_v120 = event.amount_v120(Axis::Vertical);
+ let horizontal_amount = event.amount(Axis::Horizontal).unwrap_or_else(|| {
+ // Winit backend, discrete scrolling.
+ horizontal_amount_v120.unwrap_or(0.0) / 120. * 15.
+ });
+ let vertical_amount = event.amount(Axis::Vertical).unwrap_or_else(|| {
+ // Winit backend, discrete scrolling.
+ vertical_amount_v120.unwrap_or(0.0) / 120. * 15.
+ });
+
let mut frame = AxisFrame::new(event.time_msec()).source(source);
if horizontal_amount != 0.0 {
frame = frame