aboutsummaryrefslogtreecommitdiff
path: root/src/VideoPlayer.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-05 21:15:37 +0200
committerdec05eba <dec05eba@protonmail.com>2019-08-05 21:15:40 +0200
commit92a98c6525d42a967d66492ef7bd61c4a1d7edd1 (patch)
treec42d58a473095fba0e2ec2156032c73e5e622203 /src/VideoPlayer.cpp
parent458bec27a375a94a4fbdcc547c3cfff05583985f (diff)
Dont use subpixel positions, it will make things blurry
Diffstat (limited to 'src/VideoPlayer.cpp')
-rw-r--r--src/VideoPlayer.cpp3
1 files changed, 2 insertions, 1 deletions
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 <mpv/opengl_cb.h>
#include <SFML/OpenGL.hpp>
#include <clocale>
+#include <cmath>
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) {