From 55458b04a633dba23f56c28242e879a64883a83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 17 Apr 2018 21:24:46 +0200 Subject: [PATCH] Fixed 1px map change offset & invalid zoom level --- src/GUI/mapview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GUI/mapview.cpp b/src/GUI/mapview.cpp index be7ae225..20c1d7c0 100644 --- a/src/GUI/mapview.cpp +++ b/src/GUI/mapview.cpp @@ -287,7 +287,10 @@ void MapView::setMap(Map *map) it.value()->setMap(_map); updatePOIVisibility(); - centerOn(_map->ll2xy(cr.center())); + QPointF oc = vr.center(); + QPointF nc = _map->ll2xy(cr.center()); + if (qAbs(oc.x() - nc.x()) >= 1.0 || qAbs(oc.y() - nc.y()) >= 1.0) + centerOn(nc); resetCachedContent(); QPixmapCache::clear();