From aea90e2c43d6dbf8b8276e1209f4d4abe1cea128 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 13 Nov 2022 02:05:27 +0100 Subject: Matrix: fix message edits not being applied correctly --- src/Body.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/Body.cpp') diff --git a/src/Body.cpp b/src/Body.cpp index adb774c..9eb3c98 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -315,6 +315,15 @@ namespace QuickMedia { for(size_t i = 0; i < items.size(); ++i) { if(body_item->get_timestamp() > items[i]->get_timestamp()) { items.insert(items.begin() + i, std::move(body_item)); + /* + if((int)i <= selected_item) { + if(attach_side == AttachSide::TOP) + selected_item -= 1; + else + selected_item += 1; + clamp_selection(); + } + */ return i; } } @@ -328,6 +337,15 @@ namespace QuickMedia { for(size_t i = 0; i < items.size(); ++i) { if(body_item->get_timestamp() < items[i]->get_timestamp()) { items.insert(items.begin() + i, std::move(body_item)); + /* + if((int)i <= selected_item) { + if(attach_side == AttachSide::TOP) + selected_item -= 1; + else + selected_item += 1; + clamp_selection(); + } + */ return i; } } @@ -1631,19 +1649,19 @@ namespace QuickMedia { if(item->author_text) { item->author_text->set_position(text_pos); item->author_text->draw(window); - text_offset_y += item->author_text->getHeight(); + text_offset_y += item->author_text->getHeight() + std::floor(5.0f * get_config().scale); } if(item->title_text) { item->title_text->set_position(text_pos + mgl::vec2f(0.0f, text_offset_y)); item->title_text->draw(window); - text_offset_y += item->title_text->getHeight(); + text_offset_y += item->title_text->getHeight() + std::floor(5.0f * get_config().scale); } if(item->description_text) { item->description_text->set_position(text_pos + mgl::vec2f(0.0f, text_offset_y)); item->description_text->draw(window); - text_offset_y += item->description_text->getHeight(); + text_offset_y += item->description_text->getHeight() + std::floor(5.0f * get_config().scale); } const float gradient_height = 5.0f; -- cgit v1.2.3