From 68c4259370714d9e2c1ed4cd244dbc2a60791033 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Thu, 29 Jan 2026 20:03:17 -0500 Subject: [PATCH] fix: reduce scroll catch-up steps to limit jitter (#219) Reduce max_steps from 0.1s to 0.04s of catch-up time (from 5 to 2 steps at 50 FPS). When the system lags, the previous catch-up logic allowed jumping up to 5 pixels at once, causing visible jitter. Limiting to 2 steps provides smoother scrolling while still allowing for minor timing corrections. Co-authored-by: Chuck Co-authored-by: Claude Opus 4.5 --- src/common/scroll_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/scroll_helper.py b/src/common/scroll_helper.py index 88c63ec5..56d8065f 100644 --- a/src/common/scroll_helper.py +++ b/src/common/scroll_helper.py @@ -240,7 +240,7 @@ class ScrollHelper: # Move pixels (can move multiple steps if lag occurred, but cap to prevent huge jumps) steps = int(time_since_last_step / self.scroll_delay) # Cap at reasonable number to prevent huge jumps from lag - max_steps = max(1, int(0.1 / self.scroll_delay)) # Allow up to 0.1s of catch-up + max_steps = max(1, int(0.04 / self.scroll_delay)) # Limit to 0.04s (2 steps at 50 FPS) for smoother scrolling steps = min(steps, max_steps) pixels_to_move = self.scroll_speed * steps # Update last_step_time, preserving fractional delay for smooth timing