aboutsummaryrefslogtreecommitdiff
path: root/src/Body.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Body.cpp')
-rw-r--r--src/Body.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 7133fbe..ced71fa 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -569,7 +569,9 @@ namespace QuickMedia {
prev_selected_item = selected_item;
}
- const bool merge_with_previous = body_item_merge_handler && body_item_merge_handler(get_previous_visible_item(selected_item), items[selected_item].get());
+ bool merge_with_previous = false;
+
+ merge_with_previous = body_item_merge_handler && body_item_merge_handler(get_previous_visible_item(selected_item), items[selected_item].get());
selected_item_height = get_item_height(items[selected_item].get(), size.x, true, true, merge_with_previous);
selected_item_height += spacing_y;
bool selected_item_fits_on_screen = selected_item_height <= size.y;
@@ -672,6 +674,7 @@ namespace QuickMedia {
BodyItem *prev_body_item = get_previous_visible_item(selected_item);
float prev_item_height = 0.0f;
+ merge_with_previous = false;
sf::Vector2f after_pos = pos;
for(int i = selected_item; i < num_items; ++i) {
@@ -681,7 +684,7 @@ namespace QuickMedia {
if(!item->visible)
continue;
- const bool merge_with_previous = body_item_merge_handler && body_item_merge_handler(prev_body_item, item.get());
+ merge_with_previous = body_item_merge_handler && body_item_merge_handler(prev_body_item, item.get());
if(merge_with_previous)
after_pos.y -= spacing_y;
@@ -736,7 +739,7 @@ namespace QuickMedia {
if(last_fully_visible_item == -1)
last_fully_visible_item = selected_item;
- offset_to_bottom = size.y - (after_pos.y - start_y);
+ offset_to_bottom = size.y - (after_pos.y - start_y - (last_item_fully_visible && merge_with_previous ? spacing_y : 0.0f));
if(!last_item_fully_visible_set)
last_item_fully_visible = true;
@@ -1149,7 +1152,7 @@ namespace QuickMedia {
item_thumbnail->referenced = true;
if(!item->thumbnail_url.empty() && item_thumbnail->loading_state == LoadingState::NOT_LOADED)
- AsyncImageLoader::get_instance().load_thumbnail(item->thumbnail_url, item->thumbnail_is_local, content_size, program->is_tor_enabled(), item_thumbnail);
+ AsyncImageLoader::get_instance().load_thumbnail(item->thumbnail_url, item->thumbnail_is_local, content_size, item_thumbnail);
if(item_thumbnail->loading_state == LoadingState::FINISHED_LOADING && item_thumbnail->image->getSize().x > 0 && item_thumbnail->image->getSize().y > 0) {
if(!item_thumbnail->texture.loadFromImage(*item_thumbnail->image))