Consider the scale ratio when scaling down images

fixes #393
This commit is contained in:
Konstantinos Sideris 2018-08-01 21:10:03 +03:00
parent 1f50d13b9f
commit b5b5faa5ec
5 changed files with 37 additions and 31 deletions

View file

@ -108,7 +108,7 @@ PreviewUploadOverlay::init()
const auto maxHeight = winsize.height() * 0.8;
// Scale image preview to fit into the application window.
infoLabel_.setPixmap(utils::scaleDown<QPixmap>(maxWidth, maxHeight, image_));
infoLabel_.setPixmap(utils::scaleDown(maxWidth, maxHeight, image_));
move(center.x() - (width() * 0.5), center.y() - (height() * 0.5));
} else {
infoLabel_.setAlignment(Qt::AlignLeft);