From 06b30b3cca37e9217a9658f70be7bdf8e63f74a2 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Mon, 30 Jul 2018 12:35:15 +0300 Subject: [PATCH] Use double instead of int when scaling pixmaps (#393) --- src/Utils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 809ea293..e4ca92d6 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include @@ -221,7 +222,8 @@ utils::scaleImageToPixmap(const QImage &img, int size) if (img.isNull()) return QPixmap(); - const int sz = QApplication::desktop()->screen()->devicePixelRatio() * size; + const double sz = + ceil(QApplication::desktop()->screen()->devicePixelRatioF() * (double)size); return QPixmap::fromImage( img.scaled(sz, sz, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); }