From 8ff8d4bf16a0957fc362919cb7092fd78e46bfb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 20 Jan 2017 01:17:22 +0100 Subject: [PATCH] Code cleanup --- src/pathview.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pathview.cpp b/src/pathview.cpp index 8a1a96bd..05b24eb2 100644 --- a/src/pathview.cpp +++ b/src/pathview.cpp @@ -57,6 +57,11 @@ qreal mapScale(int zoom) return ((360.0/(qreal)(1<setSceneRect(scaled(mapBounds(), 1.0 / mapScale(_zoom))); } PathView::~PathView() @@ -219,11 +226,8 @@ QList PathView::loadData(const Data &data) if (_zoom < zoom) rescale(_zoom); - else { - _scene->setSceneRect(scaled(QRectF(QPointF(-180, -180), - QSizeF(360, 360)), 1.0 / mapScale(_zoom))); + else updatePOIVisibility(); - } QPointF center = contentsCenter(); centerOn(center); @@ -304,8 +308,7 @@ void PathView::rescale(int zoom) _zoom = zoom; qreal scale = mapScale(zoom); - _scene->setSceneRect(scaled(QRectF(QPointF(-180, -180), QSizeF(360, 360)), - 1.0 / scale)); + _scene->setSceneRect(scaled(mapBounds(), 1.0 / scale)); for (int i = 0; i < _tracks.size(); i++) _tracks.at(i)->setScale(1.0/scale);