diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-11-10 19:28:21 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-11-10 19:28:21 +0100 |
commit | 9c99020b598c2e70c0d14d5ad4e7c22436af3b42 (patch) | |
tree | 463bf393b01a1d18fff170adc39940d0f7963a27 /src | |
parent | c183479553dbc81e0eb7f632720c278fa5308b2c (diff) |
Fit body item better when it cant fully fit on screen
Diffstat (limited to 'src')
-rw-r--r-- | src/Body.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index f224d06..01aabea 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -397,10 +397,10 @@ namespace QuickMedia { selected_line_top_visible = pos.y - start_y + page_scroll >= 0.0f; selected_line_bottom_visible = pos.y - start_y + page_scroll + selected_item_height <= size.y; - if(pos.y - start_y + page_scroll >= size.y) - page_scroll -= 32.0f; - else if(pos.y - start_y + page_scroll + selected_item_height <= 0.0f) - page_scroll += 32.0f; + if(pos.y - start_y + page_scroll >= size.y && !selected_item_fits_on_screen) + page_scroll = 0.0f; + else if(pos.y - start_y + page_scroll + selected_item_height <= 0.0f && !selected_item_fits_on_screen) + page_scroll = -selected_item_height + size.y; selected_line_top_visible |= selected_item_fits_on_screen; selected_line_bottom_visible |= selected_item_fits_on_screen; |