From 2d6837bd4fe8133aa0124b8fe0546e36530b3425 Mon Sep 17 00:00:00 2001 From: Nguyen Duc Toan Date: Sun, 1 Oct 2023 06:23:47 +0700 Subject: [PATCH] fix overflow --- core/src/manager/folder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/manager/folder.rs b/core/src/manager/folder.rs index 6899d1f7..32affa81 100644 --- a/core/src/manager/folder.rs +++ b/core/src/manager/folder.rs @@ -84,7 +84,7 @@ impl Folder { self.set_page(false); if self.cursor < self.offset + 5 { - self.offset = self.offset.saturating_sub(old - self.cursor); + self.offset = self.offset.saturating_sub(old.saturating_sub(self.cursor)); } old != self.cursor