From b72a9e67fe1a580ed536ae01a586be0728433126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 1 Aug 2019 18:58:19 +0200 Subject: [PATCH] Cosmetics --- src/GUI/mapview.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/GUI/mapview.cpp b/src/GUI/mapview.cpp index 06d489d2..ff17b727 100644 --- a/src/GUI/mapview.cpp +++ b/src/GUI/mapview.cpp @@ -1017,18 +1017,16 @@ void MapView::setDevicePixelRatio(qreal deviceRatio, qreal mapRatio) void MapView::setProjection(int id) { + const PCS *pcs; + const GCS *gcs; Coordinates center = _map->xy2ll(mapToScene(viewport()->rect().center())); - const PCS *pcs = PCS::pcs(id); - if (pcs) + if ((pcs = PCS::pcs(id))) _projection = Projection(pcs); - else { - const GCS *gcs = GCS::gcs(id); - if (gcs) - _projection = Projection(gcs); - else - qWarning("%d: Unknown PCS/GCS id", id); - } + else if ((gcs = GCS::gcs(id))) + _projection = Projection(gcs); + else + qWarning("%d: Unknown PCS/GCS id", id); _map->setProjection(_projection); rescale();