From 0d8293a5647c2bb10228658f0910515b38ff0d64 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 21 Oct 2020 21:32:51 +0200 Subject: Workaround sfml image loading thread race condition See: https://github.com/SFML/SFML/issues/1711 Also some other smaller changes --- src/Body.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Body.cpp') diff --git a/src/Body.cpp b/src/Body.cpp index fd29d17..6b7826d 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -59,8 +59,8 @@ namespace QuickMedia { { progress_text.setFillColor(sf::Color::White); replies_text.setFillColor(sf::Color(129, 162, 190)); - thumbnail_resize_target_size.x = 250; - thumbnail_resize_target_size.y = 141; + thumbnail_max_size.x = 250; + thumbnail_max_size.y = 141; item_background.setFillColor(sf::Color(55, 60, 68)); sf::Vector2f loading_icon_size(loading_icon.getTexture()->getSize().x, loading_icon.getTexture()->getSize().y); loading_icon.setOrigin(loading_icon_size.x * 0.5f, loading_icon_size.y * 0.5f); @@ -387,8 +387,8 @@ namespace QuickMedia { } update_dirty_state(item.get(), size); - float item_height = get_item_height(item.get()); item->last_drawn_time = elapsed_time_sec; + float item_height = get_item_height(item.get()); // This is needed here rather than above the loop, since update_dirty_text cant be called inside scissor because it corrupts the text for some reason glEnable(GL_SCISSOR_TEST); @@ -509,9 +509,9 @@ namespace QuickMedia { sf::Vector2i Body::get_item_thumbnail_size(BodyItem *item) const { sf::Vector2i content_size; if(item->thumbnail_size.x > 0 && item->thumbnail_size.y > 0) - content_size = clamp_to_size(item->thumbnail_size, thumbnail_resize_target_size); + content_size = clamp_to_size(item->thumbnail_size, thumbnail_max_size); else - content_size = thumbnail_resize_target_size; + content_size = thumbnail_max_size; return content_size; } -- cgit v1.2.3