Fix underflow in scrolling

When window was smaller than whole display
scrolling by small step could cause underflow
in the offset computation.
This commit is contained in:
Ales Musil 2021-01-21 13:18:36 +01:00
parent 509060bb5d
commit e350936d82

View file

@ -225,7 +225,7 @@ where
scroller.top_offset += num_lines;
if scroller.top_offset > (scroller.height - scroller.fixed_bottom_lines) {
scroller.top_offset = scroller.fixed_top_lines
+ (scroller.top_offset - scroller.height + scroller.fixed_bottom_lines)
+ (scroller.top_offset + scroller.fixed_bottom_lines - scroller.height)
}
self.command(