aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-03-24 08:57:09 +0100
committerdec05eba <dec05eba@protonmail.com>2021-03-24 08:57:09 +0100
commit63cef77fd2373544958eaa478fa0a7ad04ddfa6e (patch)
tree9c661d9b17ae220bf22ebc72d252e666738be174 /src
parent2040c0cae5fc845127399624f0e3a6586cd5ac85 (diff)
Pee pee poo poo
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;