From 1743730fd9efbf54ecf15107872dd5b14a93b8c0 Mon Sep 17 00:00:00 2001 From: Arthur Cosentino Date: Sat, 9 Nov 2024 07:26:04 -0500 Subject: [PATCH] Accumulate mouse scrolls for smoother scrolling --- src/mouse_reporter.rs | 79 +++++++++++++++++++++++++++++-------------- src/terminal.rs | 10 ++++-- 2 files changed, 62 insertions(+), 27 deletions(-) diff --git a/src/mouse_reporter.rs b/src/mouse_reporter.rs index 40ec38f..1305240 100644 --- a/src/mouse_reporter.rs +++ b/src/mouse_reporter.rs @@ -11,6 +11,8 @@ const SCROLL_SPEED: u32 = 3; pub struct MouseReporter { last_movment_x: Option, last_movment_y: Option, + accumulated_scroll_x: f32, + accumulated_scroll_y: f32, button: Option