diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-03-24 08:51:13 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-03-24 08:51:13 +0100 |
commit | 2040c0cae5fc845127399624f0e3a6586cd5ac85 (patch) | |
tree | 4fdb1ec8c6fe93411483b9f4755aa503aec4ce91 | |
parent | 84d4d43d2f79da48c3494e11c8b29790fb6eae12 (diff) |
Matrix: merged last visible items should be counted as the last visible item
-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 ee84f5f..d25e5c8 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -605,7 +605,7 @@ namespace QuickMedia { BodyItem *next_body_item = get_next_visible_item(selected_item); const bool merge_with_next = next_body_item && body_item_merge_handler && body_item_merge_handler(items[selected_item].get(), next_body_item); - if(merge_with_next) + if(!merge_with_previous && merge_with_next) page_scroll += spacing_y; } else if(page_scroll < 0.0f && selected_line_top_visible && selected_item_fits_on_screen) { //fprintf(stderr, "bottom!\n"); @@ -682,12 +682,12 @@ namespace QuickMedia { if(merge_with_previous) after_pos.y -= spacing_y; - if(after_pos.y < start_y) { + if(after_pos.y - (merge_with_previous ? 0.0f : spacing_y) < start_y) { items_cut_off = true; first_item_fully_visible = false; } - if(after_pos.y - start_y >= size.y) { + if(after_pos.y - start_y - (merge_with_previous ? 0.0f : spacing_y) >= size.y) { if(first_fully_visible_item == -1) first_item_fully_visible = false; last_item_fully_visible = false; @@ -709,7 +709,7 @@ namespace QuickMedia { after_pos.y += spacing_y; ++num_visible_items; - if(after_pos.y - start_y > size.y) { + if(after_pos.y - start_y - (merge_with_previous ? 0.0f : spacing_y) > size.y) { last_item_fully_visible = false; items_cut_off = true; last_item_fully_visible_set = true; |