2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Fixed PhotoCropBox for Retina displays.

This commit is contained in:
John Preston
2016-10-09 01:06:21 +03:00
parent 377d333f1c
commit 2d9ccbc428

View File

@@ -61,9 +61,10 @@ void PhotoCropBox::init(const QImage &img, PeerData *peer) {
}
int32 s = st::boxWideWidth - st::boxPhotoPadding.left() - st::boxPhotoPadding.right();
_thumb = App::pixmapFromImageInPlace(img.scaled(s, s, Qt::KeepAspectRatio, Qt::SmoothTransformation));
_thumbw = _thumb.width();
_thumbh = _thumb.height();
_thumb = App::pixmapFromImageInPlace(img.scaled(s * cIntRetinaFactor(), s * cIntRetinaFactor(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
_thumb.setDevicePixelRatio(cRetinaFactor());
_thumbw = _thumb.width() / cIntRetinaFactor();
_thumbh = _thumb.height() / cIntRetinaFactor();
if (_thumbw > _thumbh) {
_cropw = _thumbh - 20;
} else {