vertically center images

This commit is contained in:
Anton Thomasson 2020-05-13 20:18:20 +02:00
parent f7aba42af2
commit ef9b222c35

View file

@ -120,7 +120,7 @@ void ConvertWorker::convertImage(QNetworkRequest request, QString filename, QTem
QImage outImage = QImage(Width, Height, inImage.format()); QImage outImage = QImage(Width, Height, inImage.format());
outImage.fill(Qt::white); outImage.fill(Qt::white);
QPainter painter(&outImage); QPainter painter(&outImage);
painter.drawImage(0,0, inImage); painter.drawImage(0, (outImage.height()-inImage.height())/2, inImage);
painter.end(); painter.end();
QTemporaryFile tmpImage; QTemporaryFile tmpImage;