mirror of
https://github.com/yuri91/ili9341-rs.git
synced 2024-11-24 23:50:59 +00:00
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:
parent
509060bb5d
commit
e350936d82
1 changed files with 1 additions and 1 deletions
|
@ -225,7 +225,7 @@ where
|
||||||
scroller.top_offset += num_lines;
|
scroller.top_offset += num_lines;
|
||||||
if scroller.top_offset > (scroller.height - scroller.fixed_bottom_lines) {
|
if scroller.top_offset > (scroller.height - scroller.fixed_bottom_lines) {
|
||||||
scroller.top_offset = scroller.fixed_top_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(
|
self.command(
|
||||||
|
|
Loading…
Reference in a new issue