diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-03-27 19:55:19 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-03-27 19:55:19 +0100 |
commit | c7457de5aa37cd44b30f59677c4482bcd7d6de80 (patch) | |
tree | 6dacda2e35a272058ae853b8a4e5bc4b5b79e8d1 /src | |
parent | 3eca2373621b4fbd3189df75ada884861536113a (diff) |
Fix annoying body item flickering. There is still a 1 frame delay to apply it though
Diffstat (limited to 'src')
-rw-r--r-- | src/Body.cpp | 15 |
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)); |