aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-09-24 05:28:29 +0200
committerdec05eba <dec05eba@protonmail.com>2021-09-24 05:28:29 +0200
commit4ae711eb3ca9157cf90de946517a1a2726d27024 (patch)
tree54357f255ac53525d5291f3f92c58253eb41567f
parentf0f6d45cd3aa39f1eea4e8fd1518edeee50689ef (diff)
Show failed to load youtube subscriptions first, floor 4chan image for better quality after moving it
-rw-r--r--src/QuickMedia.cpp8
-rw-r--r--src/plugins/Youtube.cpp2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 9122108..9483d6b 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -3797,6 +3797,10 @@ namespace QuickMedia {
return sf::Vector2f(vec.x, vec.y);
}
+ static sf::Vector2f floor(sf::Vector2f vec) {
+ return { std::floor(vec.x), std::floor(vec.y) };
+ }
+
void Program::image_board_thread_page(ImageBoardThreadPage *thread_page, Body *thread_body) {
// TODO: Instead of using stage here, use different pages for each stage
enum class NavigationStage {
@@ -4439,9 +4443,9 @@ namespace QuickMedia {
} else if(navigation_stage == NavigationStage::VIEWING_ATTACHED_IMAGE) {
if(attached_image_texture->getNativeHandle() != 0) {
if(image_control.moved) {
- attached_image_sprite.setOrigin(image_control.offset);
+ attached_image_sprite.setOrigin(floor(image_control.offset));
attached_image_sprite.setScale(image_control.zoom, image_control.zoom);
- attached_image_sprite.setPosition(window_size * 0.5f);
+ attached_image_sprite.setPosition(floor(window_size * 0.5f));
window.draw(attached_image_sprite);
} else {
auto content_size = window_size;
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index 06e030b..012a20b 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -1690,7 +1690,7 @@ namespace QuickMedia {
DownloadResult result = download_to_string("https://www.youtube.com/feeds/videos.xml?channel_id=" + url_param_encode(channel_id), website_data, {}, false);
if(result != DownloadResult::OK) {
auto body_item = BodyItem::create("Failed to fetch videos for channel: " + channel_id);
- return {YoutubeSubscriptionTaskResult{body_item, 0}};
+ return {YoutubeSubscriptionTaskResult{body_item, time_now}};
}
SubscriptionData subscription_data;