1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-31 00:55:13 +01:00

Improved image part drawing procedure

This commit is contained in:
Martin Tůma 2017-08-09 17:58:37 +02:00
parent e792bf3b23
commit b8a9a4481c

View File

@ -621,9 +621,9 @@ void OfflineMap::drawImage(QPainter *painter, const QRectF &rect)
if (!_img || _img->isNull())
painter->fillRect(rect, Qt::white);
else {
QPoint p = rect.topLeft().toPoint();
QImage crop = _img->copy(QRect(p, rect.size().toSize()));
painter->drawImage(rect.topLeft(), crop);
QRect r(rect.topLeft().toPoint(), rect.size().toSize());
painter->drawImage(rect.left(), rect.top(), *_img, r.left(), r.top(),
r.width(), r.height());
}
}