From cf756c2282f7ede23fa4b8ff9f2cfbdc41aee0fa Mon Sep 17 00:00:00 2001 From: "Matheus T. dos Santos" Date: Sun, 29 Sep 2024 19:37:55 -0300 Subject: [PATCH] fix: fix scroll bug which jumps to start when scrolled up --- src/graphics/graphics_task.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/graphics/graphics_task.rs b/src/graphics/graphics_task.rs index 46d0013..d319c44 100644 --- a/src/graphics/graphics_task.rs +++ b/src/graphics/graphics_task.rs @@ -108,11 +108,10 @@ impl GraphicsTask { blink_color: Color, ) { private.last_frame_height = frame.size().height; - let scroll = if private.auto_scroll { - (Self::max_main_axis(&private), private.scroll.1) - } else { - private.scroll - }; + if private.auto_scroll { + private.scroll.0 = Self::max_main_axis(&private); + } + let scroll = private.scroll; let (coll, coll_size) = ( private.history.range(scroll.0 as usize..).filter(|msg| {