aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-12 03:32:08 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-12 03:32:08 +0100
commitb7ee32e6037aea851575ba44af85b48eca0a3886 (patch)
treebbcd392ca5e170e308f58ad4feddb43b5697f63c /src
parent0df442e04c57dd80fc9a6b885b2ba86442b405b9 (diff)
Attempt to fix flickering body
Diffstat (limited to 'src')
-rw-r--r--src/Body.cpp6
-rw-r--r--src/QuickMedia.cpp2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 74646fd..2cf6f78 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -453,10 +453,11 @@ namespace QuickMedia {
float item_height = get_item_height(item.get(), size.x);
prev_pos.y -= (item_height + spacing_y);
- if(prev_pos.y + item_height + spacing_y <= start_y) {
+ if(prev_pos.y < start_y)
items_cut_off = true;
+
+ if(prev_pos.y + item_height + spacing_y <= start_y)
break;
- }
// 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);
@@ -495,6 +496,7 @@ namespace QuickMedia {
if(after_pos.y - start_y > size.y) {
last_item_fully_visible = false;
+ items_cut_off = true;
} else {
last_fully_visible_item = i;
}
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 590eb86..644ed6f 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -3116,7 +3116,7 @@ namespace QuickMedia {
pinned_tab.body = std::make_unique<Body>(this, loading_icon);
pinned_tab.body->thumbnail_max_size = CHAT_MESSAGE_THUMBNAIL_MAX_SIZE;
pinned_tab.body->thumbnail_mask_shader = &circle_mask_shader;
- pinned_tab.body->attach_side = AttachSide::TOP;
+ pinned_tab.body->attach_side = AttachSide::BOTTOM;
//pinned_tab.body->line_separator_color = sf::Color::Transparent;
pinned_tab.text = sf::Text("Pinned messages", *FontLoader::get_font(FontLoader::FontType::LATIN), tab_text_size);
tabs.push_back(std::move(pinned_tab));