mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Use double instead of int when scaling pixmaps (#393)
This commit is contained in:
parent
6ffb747421
commit
06b30b3cca
1 changed files with 3 additions and 1 deletions
|
@ -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…
Reference in a new issue