From fd9178b9d500a0b5f30f388f8d419ac386ce87cb Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 17 Oct 2020 00:35:20 +0200 Subject: Matrix: edit/redact the referenced message instead of appending a new message --- src/Body.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/Body.cpp') diff --git a/src/Body.cpp b/src/Body.cpp index 75706c1..9b12f43 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -178,6 +178,7 @@ namespace QuickMedia { assert(item >= 0 && item < (int)items.size()); selected_item = item; prev_selected_item = selected_item; + clamp_selection(); //page_scroll = 0.0f; } @@ -291,21 +292,16 @@ namespace QuickMedia { for(int i = selected_item; i >= 0; --i) { if(items[i]->visible) { selected_item = i; - goto reset_scroll; + return; } } - for(int i = selected_item; i < num_items; ++i) { + for(int i = selected_item + 1; i < num_items; ++i) { if(items[i]->visible) { selected_item = i; - goto reset_scroll; + return; } } - - reset_scroll: - {} - //prev_selected_item = selected_item; - //page_scroll = 0.0f; } void Body::draw(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size) { @@ -314,7 +310,6 @@ namespace QuickMedia { // TODO: Use a render target for the whole body so all images can be put into one. // TODO: Load thumbnails with more than one thread. - // TODO: Show chapters (rows) that have been read differently to make it easier to see what hasn't been read yet. void Body::draw(sf::RenderWindow &window, sf::Vector2f pos, sf::Vector2f size, const Json::Value &content_progress) { sf::Vector2f scissor_pos = pos; sf::Vector2f scissor_size = size; -- cgit v1.2.3