1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-27 11:39:16 +02:00

Moved all the map bounds checking where it belongs

This commit is contained in:
2017-12-03 10:41:07 +01:00
parent 179f2f1451
commit 5bdc263cda
3 changed files with 14 additions and 20 deletions

View File

@ -738,11 +738,14 @@ void MapView::setBackgroundColor(const QColor &color)
void MapView::drawBackground(QPainter *painter, const QRectF &rect)
{
if (_showMap) {
if (_opacity < 1.0) {
QRectF ir = rect.intersected(_map->bounds());
if (_opacity < 1.0 || ir != rect)
painter->fillRect(rect, _backgroundColor);
if (_opacity < 1.0)
painter->setOpacity(_opacity);
}
_map->draw(painter, rect);
_map->draw(painter, ir);
} else
painter->fillRect(rect, _backgroundColor);
}