From 92a98c6525d42a967d66492ef7bd61c4a1d7edd1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 5 Aug 2019 21:15:37 +0200 Subject: Dont use subpixel positions, it will make things blurry --- src/VideoPlayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/VideoPlayer.cpp') diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp index 88e2340..bcc419c 100644 --- a/src/VideoPlayer.cpp +++ b/src/VideoPlayer.cpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace QuickMedia { static void* getProcAddressMpv(void *funcContext, const char *name) { @@ -124,7 +125,7 @@ namespace QuickMedia { auto image_size = sf::Vector2f(video_size.x, video_size.y); image_size.x *= image_scale.x; image_size.y *= image_scale.y; - sprite.setPosition(desired_size.x * 0.5f - image_size.x * 0.5f, desired_size.y * 0.5f - image_size.y * 0.5f); + sprite.setPosition(std::floor(desired_size.x * 0.5f - image_size.x * 0.5f), std::floor(desired_size.y * 0.5f - image_size.y * 0.5f)); } void VideoPlayer::draw(sf::RenderWindow &window) { -- cgit v1.2.3