From b8a9a4481caa69de6d3a2ac0f62a14eabd5ab004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 9 Aug 2017 17:58:37 +0200 Subject: [PATCH] Improved image part drawing procedure --- src/offlinemap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/offlinemap.cpp b/src/offlinemap.cpp index a0d0e240..0f49a01f 100644 --- a/src/offlinemap.cpp +++ b/src/offlinemap.cpp @@ -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()); } }