diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-03-27 21:20:26 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-03-27 21:20:26 +0100 |
commit | 725c36eee8291b7d4d0eca1b4c49ee8830270fc1 (patch) | |
tree | 7d76b04c99527aec7da368a6a7de921407947042 /src | |
parent | c7457de5aa37cd44b30f59677c4482bcd7d6de80 (diff) |
Once upon a time there was a man. He was retarded. That man was me
Diffstat (limited to 'src')
-rw-r--r-- | src/Body.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index 75bf092..c2a7681 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -586,10 +586,17 @@ namespace QuickMedia { selected_line_bottom_visible |= selected_item_fits_on_screen; if(keep_selected_inside_body) { - if(attach_side == AttachSide::TOP && std::abs(offset_to_top) > 0.1f) - page_scroll -= offset_to_top; - else if(attach_side == AttachSide::BOTTOM && std::abs(offset_to_bottom) > 0.1f) - page_scroll += offset_to_bottom; + if(!first_item_fully_visible && !last_item_fully_visible) { + if(offset_to_top > 0.0f) + page_scroll -= offset_to_top; + else if(offset_to_bottom > 0.0f) + page_scroll += offset_to_bottom; + } else { + if(attach_side == AttachSide::TOP) + page_scroll -= offset_to_top; + else if(attach_side == AttachSide::BOTTOM) + page_scroll += offset_to_bottom; + } if(page_scroll > size.y - selected_item_height && selected_item_fits_on_screen) { //fprintf(stderr, "top: %f\n", page_scroll - (size.y - selected_item_height)); |