fix overflow

This commit is contained in:
Nguyen Duc Toan 2023-10-01 06:23:47 +07:00
parent 9525bba73e
commit 2d6837bd4f

View file

@ -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