aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Body.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index d25e5c8..247424b 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -682,12 +682,12 @@ namespace QuickMedia {
if(merge_with_previous)
after_pos.y -= spacing_y;
- if(after_pos.y - (merge_with_previous ? 0.0f : spacing_y) < start_y) {
+ if(after_pos.y < start_y) {
items_cut_off = true;
first_item_fully_visible = false;
}
- if(after_pos.y - start_y - (merge_with_previous ? 0.0f : spacing_y) >= size.y) {
+ if(after_pos.y - start_y >= size.y) {
if(first_fully_visible_item == -1)
first_item_fully_visible = false;
last_item_fully_visible = false;
@@ -709,7 +709,10 @@ namespace QuickMedia {
after_pos.y += spacing_y;
++num_visible_items;
- if(after_pos.y - start_y - (merge_with_previous ? 0.0f : spacing_y) > size.y) {
+ BodyItem *next_body_item = get_next_visible_item(i);
+ const bool merge_with_next = next_body_item && body_item_merge_handler && body_item_merge_handler(item.get(), next_body_item);
+
+ if(after_pos.y - start_y - (merge_with_next ? 0.0f : spacing_y) > size.y) {
last_item_fully_visible = false;
items_cut_off = true;
last_item_fully_visible_set = true;