Use double instead of int when scaling pixmaps (#393)

pull/1/head
Konstantinos Sideris 6 years ago
parent 6ffb747421
commit 06b30b3cca
  1. 4
      src/Utils.cpp

@ -3,6 +3,7 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QSettings>
#include <cmath>
#include <variant.hpp>
@ -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));
}

Loading…
Cancel
Save