From b7ee32e6037aea851575ba44af85b48eca0a3886 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 12 Nov 2020 03:32:08 +0100 Subject: Attempt to fix flickering body --- src/Body.cpp | 6 ++++-- src/QuickMedia.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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(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)); -- cgit v1.2.3