aboutsummaryrefslogtreecommitdiff
path: root/src/Body.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-17 00:35:20 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-17 00:35:20 +0200
commitfd9178b9d500a0b5f30f388f8d419ac386ce87cb (patch)
tree11e1b37679649960f1d1c72b68690c4396da4f68 /src/Body.cpp
parent3f9185ad357fb70138d3ea301cd9ac0ee0de0704 (diff)
Matrix: edit/redact the referenced message instead of appending a new message
Diffstat (limited to 'src/Body.cpp')
-rw-r--r--src/Body.cpp13
1 files changed, 4 insertions, 9 deletions
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;