mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 03:18:49 +03:00
Remove pixel ratio from image scaling
This commit is contained in:
parent
04c888c44c
commit
6d1f2ea9b3
1 changed files with 0 additions and 6 deletions
|
@ -234,12 +234,6 @@ utils::scaleDown(uint64_t maxWidth, uint64_t maxHeight, const QPixmap &source)
|
||||||
if (source.isNull())
|
if (source.isNull())
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
|
|
||||||
const double pixelRatio = QApplication::desktop()->screen()->devicePixelRatioF();
|
|
||||||
|
|
||||||
// Take into account the scale factor of the screen.
|
|
||||||
maxWidth = std::ceil(pixelRatio * (double)maxWidth);
|
|
||||||
maxHeight = std::ceil(pixelRatio * (double)maxHeight);
|
|
||||||
|
|
||||||
const double widthRatio = (double)maxWidth / (double)source.width();
|
const double widthRatio = (double)maxWidth / (double)source.width();
|
||||||
const double heightRatio = (double)maxHeight / (double)source.height();
|
const double heightRatio = (double)maxHeight / (double)source.height();
|
||||||
const double minAspectRatio = std::min(widthRatio, heightRatio);
|
const double minAspectRatio = std::min(widthRatio, heightRatio);
|
||||||
|
|
Loading…
Reference in a new issue