mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-26 22:20:18 +00:00
Revert scroll fix.
This commit is contained in:
parent
fd32de2774
commit
e4597730bd
1 changed files with 2 additions and 6 deletions
|
@ -76,10 +76,7 @@ pub fn get_start_position(
|
||||||
) -> u64 {
|
) -> u64 {
|
||||||
match scroll_direction {
|
match scroll_direction {
|
||||||
app::ScrollDirection::DOWN => {
|
app::ScrollDirection::DOWN => {
|
||||||
if currently_selected_position < num_rows {
|
if currently_selected_position < *previously_scrolled_position + num_rows {
|
||||||
// Can we see it outright?
|
|
||||||
0
|
|
||||||
} else if currently_selected_position < *previously_scrolled_position + num_rows {
|
|
||||||
// If, using previous_scrolled_position, we can see the element
|
// If, using previous_scrolled_position, we can see the element
|
||||||
// (so within that and + num_rows) just reuse the current previously scrolled position
|
// (so within that and + num_rows) just reuse the current previously scrolled position
|
||||||
*previously_scrolled_position
|
*previously_scrolled_position
|
||||||
|
@ -93,9 +90,8 @@ pub fn get_start_position(
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO: [FIX] This is bugged. Scrolling up then resizing is a no go!
|
|
||||||
app::ScrollDirection::UP => {
|
app::ScrollDirection::UP => {
|
||||||
if currently_selected_position < *previously_scrolled_position {
|
if currently_selected_position <= *previously_scrolled_position {
|
||||||
// If it's past the first element, then show from that element downwards
|
// If it's past the first element, then show from that element downwards
|
||||||
*previously_scrolled_position = currently_selected_position;
|
*previously_scrolled_position = currently_selected_position;
|
||||||
*previously_scrolled_position
|
*previously_scrolled_position
|
||||||
|
|
Loading…
Reference in a new issue