From b8a2cc5720efaae1c3bb9acbce0fdf7753e51ca5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 14 Oct 2020 04:37:32 +0200 Subject: Reset window size redraw after switching page, to fix rendering size issues. Disable manga images mipmap --- src/QuickMedia.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 01e244a..e34f991 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -934,8 +934,9 @@ namespace QuickMedia { int selected_tab = 0; bool loop_running = true; + bool redraw = true; - auto submit_handler = [this, &tabs, &selected_tab, &loop_running]() { + auto submit_handler = [this, &tabs, &selected_tab, &loop_running, &redraw]() { BodyItem *selected_item = tabs[selected_tab].body->get_selected(); if(!selected_item) return; @@ -994,12 +995,15 @@ namespace QuickMedia { } } window.setKeyRepeatEnabled(true); + redraw = true; } else if(new_tabs.size() == 1 && new_tabs[0].page->is_image_board_thread_page()) { current_page = PageType::IMAGE_BOARD_THREAD; image_board_thread_page(static_cast(new_tabs[0].page.get()), new_tabs[0].body.get()); + redraw = true; } else if(new_tabs.size() == 1 && new_tabs[0].page->is_video_page()) { current_page = PageType::VIDEO_CONTENT; video_content_page(new_tabs[0].page.get(), selected_item->url, selected_item->get_title()); + redraw = true; } else { page_loop(std::move(new_tabs)); } @@ -1042,7 +1046,6 @@ namespace QuickMedia { sf::Vector2f body_pos; sf::Vector2f body_size; - bool redraw = true; sf::Event event; const float tab_spacer_height = 0.0f; @@ -1804,7 +1807,7 @@ namespace QuickMedia { if(image.loadFromFile(image_path.data)) { if(image_texture.loadFromImage(image)) { image_texture.setSmooth(true); - image_texture.generateMipmap(); + //image_texture.generateMipmap(); return LoadImageResult::OK; } else { error_message = std::string("Failed to load image for page ") + std::to_string(image_index + 1); -- cgit v1.2.3