1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 14:53:21 +02:00

The true cause of the map switch offset...

This commit is contained in:
Martin Tůma 2018-04-18 22:02:24 +02:00
parent bb10f7c0e1
commit e1532b978f

View File

@ -287,9 +287,8 @@ void MapView::setMap(Map *map)
it.value()->setMap(_map);
updatePOIVisibility();
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)
QPointF nc = QRectF(_map->ll2xy(cr.topLeft()),
_map->ll2xy(cr.bottomRight())).center();
centerOn(nc);
resetCachedContent();