diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-21 21:32:51 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-21 22:31:36 +0200 |
commit | 0d8293a5647c2bb10228658f0910515b38ff0d64 (patch) | |
tree | e97c10442c73e330672277940aaf0b38d2fc63eb /src/Body.cpp | |
parent | 87fb6e5c0cce6e6aba8f646329af6f8070d27c63 (diff) |
Workaround sfml image loading thread race condition
See: https://github.com/SFML/SFML/issues/1711
Also some other smaller changes
Diffstat (limited to 'src/Body.cpp')
-rw-r--r-- | src/Body.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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; } |