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:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user