this, SIGNAL(locationItemClicked(QList<QString>)));
m_scroller = &MapScroller::getInstance();
+
+ connect(m_scroller, SIGNAL(coordinateUpdated(QPoint)),
+ this, SLOT(setLocation(QPoint)));
}
MapEngine::~MapEngine()
qDebug() << __PRETTY_FUNCTION__;
// jump to opposite side of the world if world horizontal limit is exceeded
- if (sceneCoordinate.x() < MAP_MIN_PIXEL_X)
- sceneCoordinate.setX(sceneCoordinate.x() + MAP_PIXELS_X);
- else if (sceneCoordinate.x() > MAP_MAX_PIXEL_X)
- sceneCoordinate.setX(sceneCoordinate.x() - MAP_PIXELS_X);
+ sceneCoordinate.setX(normalize(sceneCoordinate.x(), MAP_MIN_PIXEL_X, MAP_MAX_PIXEL_X));
// don't allow vertical scene coordinates go out of the map
sceneCoordinate.setY(qBound(MAP_MIN_PIXEL_Y, sceneCoordinate.y(), MAP_MAX_PIXEL_Y));