aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-06 04:03:53 +0200
committerdec05eba <dec05eba@protonmail.com>2019-08-06 04:03:56 +0200
commitc635fc3fc4467f3e561e236d46534b6be735a645 (patch)
tree5c5e402286f2352fe2c58dc14f116cc8947588d1
parent9317ff35fc8e47259ba362c400b93fe9f77fa2c8 (diff)
Sleep until events when viewing manga
-rw-r--r--src/QuickMedia.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 3cfbc08..c16ee2d 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -439,7 +439,7 @@ namespace QuickMedia {
json_chapters = Json::Value(Json::objectValue);
json_chapter = Json::Value(Json::objectValue);
}
- json_chapter["current"] = latest_read;
+ json_chapter["current"] = std::min(latest_read, num_images);
json_chapter["total"] = num_images;
json_chapters[chapter_title] = json_chapter;
if(!save_manga_progress_json(content_storage_file, content_storage_json)) {
@@ -460,7 +460,7 @@ namespace QuickMedia {
// TODO: Show to user if a certain page is missing (by checking page name (number) and checking if some are skipped)
while (current_page == Page::IMAGES) {
- while (window.pollEvent(event)) {
+ if(window.waitEvent(event)) {
if (event.type == sf::Event::Closed) {
current_page = Page::EXIT;
} else if(event.type == sf::Event::Resized) {