aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Body.cpp8
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;