diff options
author | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-02-18 23:04:50 -0500 |
---|---|---|
committer | ClementTsang <cjhtsang@uwaterloo.ca> | 2020-02-18 23:04:50 -0500 |
commit | e4597730bd88c64cf8ece485a01e6cc6bbfb6b61 (patch) | |
tree | 84ce4ec60d293bc91a7c7c594197aa51d4eab09f /src | |
parent | fd32de2774284f6bf9eb596d7cdf87adfcf9b0ab (diff) |
Revert scroll fix.
Diffstat (limited to 'src')
-rw-r--r-- | src/canvas/drawing_utils.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/canvas/drawing_utils.rs b/src/canvas/drawing_utils.rs index 0670af33..62db65e6 100644 --- a/src/canvas/drawing_utils.rs +++ b/src/canvas/drawing_utils.rs @@ -76,10 +76,7 @@ pub fn get_start_position( ) -> u64 { match scroll_direction { app::ScrollDirection::DOWN => { - if currently_selected_position < num_rows { - // Can we see it outright? - 0 - } else if currently_selected_position < *previously_scrolled_position + num_rows { + if currently_selected_position < *previously_scrolled_position + num_rows { // If, using previous_scrolled_position, we can see the element // (so within that and + num_rows) just reuse the current previously scrolled position *previously_scrolled_position @@ -93,9 +90,8 @@ pub fn get_start_position( 0 } } - // TODO: [FIX] This is bugged. Scrolling up then resizing is a no go! 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 *previously_scrolled_position = currently_selected_position; *previously_scrolled_position |