aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Body.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index e4d4e97..75bf092 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -586,17 +586,10 @@ namespace QuickMedia {
selected_line_bottom_visible |= selected_item_fits_on_screen;
if(keep_selected_inside_body) {
- if(items_cut_off) {
- 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(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(page_scroll > size.y - selected_item_height && selected_item_fits_on_screen) {
//fprintf(stderr, "top: %f\n", page_scroll - (size.y - selected_item_height));