1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2018-10-15 01:15:00 +02:00
parent 4a612f12bb
commit c0adabe3f1

View File

@ -21,6 +21,7 @@
#define MARGIN 10 #define MARGIN 10
#define SCALE_OFFSET 7 #define SCALE_OFFSET 7
MapView::MapView(Map *map, POI *poi, QWidget *parent) MapView::MapView(Map *map, POI *poi, QWidget *parent)
: QGraphicsView(parent) : QGraphicsView(parent)
{ {
@ -438,10 +439,10 @@ void MapView::zoom(int zoom, const QPoint &pos)
digitalZoom(zoom); digitalZoom(zoom);
} else { } else {
Coordinates c = _map->xy2ll(mapToScene(pos)); Coordinates c = _map->xy2ll(mapToScene(pos));
qreal os = _map->zoom(); int oz = _map->zoom();
qreal ns = (zoom > 0) ? _map->zoomIn() : _map->zoomOut(); int nz = (zoom > 0) ? _map->zoomIn() : _map->zoomOut();
if (ns != os) { if (nz != oz) {
rescale(); rescale();
centerOn(_map->ll2xy(c) - (pos - viewport()->rect().center())); centerOn(_map->ll2xy(c) - (pos - viewport()->rect().center()));
} else { } else {