1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-04-13 17:19:09 +02:00

Code cleanup

This commit is contained in:
Martin Tůma 2017-06-27 22:42:59 +02:00
parent 002b9c35e1
commit 65045dfee4

View File

@ -271,7 +271,7 @@ void PathView::setPalette(const Palette &palette)
void PathView::setMap(Map *map) void PathView::setMap(Map *map)
{ {
QPointF pos = mapToScene(QRect(QPoint(), viewport()->size()).center()); QPointF pos = mapToScene(viewport()->rect().center());
Coordinates center = _map->xy2ll(pos); Coordinates center = _map->xy2ll(pos);
qreal resolution = _map->resolution(pos); qreal resolution = _map->resolution(pos);
@ -299,9 +299,10 @@ void PathView::setMap(Map *map)
it.value()->setMap(_map); it.value()->setMap(_map);
updatePOIVisibility(); updatePOIVisibility();
centerOn(_map->ll2xy(center)); pos = _map->ll2xy(center);
centerOn(pos);
_res = _map->resolution(_map->ll2xy(center)); _res = _map->resolution(pos);
_mapScale->setResolution(_res); _mapScale->setResolution(_res);
resetCachedContent(); resetCachedContent();
@ -476,7 +477,7 @@ void PathView::keyPressEvent(QKeyEvent *event)
{ {
int z; int z;
QPoint pos = QRect(QPoint(), viewport()->size()).center(); QPoint pos = viewport()->rect().center();
Coordinates c = _map->xy2ll(mapToScene(pos)); Coordinates c = _map->xy2ll(mapToScene(pos));
if (event->matches(ZOOM_IN)) if (event->matches(ZOOM_IN))