From 2040c0cae5fc845127399624f0e3a6586cd5ac85 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 24 Mar 2021 08:51:13 +0100 Subject: Matrix: merged last visible items should be counted as the last visible item --- src/Body.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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; -- cgit v1.2.3