mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Improved image part drawing procedure
This commit is contained in:
parent
e792bf3b23
commit
b8a9a4481c
@ -621,9 +621,9 @@ void OfflineMap::drawImage(QPainter *painter, const QRectF &rect)
|
|||||||
if (!_img || _img->isNull())
|
if (!_img || _img->isNull())
|
||||||
painter->fillRect(rect, Qt::white);
|
painter->fillRect(rect, Qt::white);
|
||||||
else {
|
else {
|
||||||
QPoint p = rect.topLeft().toPoint();
|
QRect r(rect.topLeft().toPoint(), rect.size().toSize());
|
||||||
QImage crop = _img->copy(QRect(p, rect.size().toSize()));
|
painter->drawImage(rect.left(), rect.top(), *_img, r.left(), r.top(),
|
||||||
painter->drawImage(rect.topLeft(), crop);
|
r.width(), r.height());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user