checkAllFriendsForCollidingFriends();
}
-void FriendItemsHandler::spanHiddenFriendLocationItems(ScrollDirection direction, QRect spanRect, QPoint sceneCoordinate)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- int delta = -WORLD_PIXELS_X;
- if (sceneCoordinate.x() > spanRect.right())
- delta = WORLD_PIXELS_X;
-
- foreach (FriendLocationItem *item, m_friendItems) {
- if (!item->isVisible() && spanRect.contains(item->pos().toPoint()))
- item->moveBy(delta, 0);
- }
-}
-
void FriendItemsHandler::updateFriendItem(FriendLocationItem *friendItem, User *friendData)
{
qDebug() << __PRETTY_FUNCTION__;
connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
m_friendItemsHandler, SLOT(friendListUpdated(QList<User*>&)));
+ connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
+ this, SLOT(friendsPositionsUpdated()));
+
connect(m_friendItemsHandler, SIGNAL(locationItemClicked(QList<QString>)),
this, SIGNAL(locationItemClicked(QList<QString>)));
}
return false;
}
+void MapEngine::friendsPositionsUpdated()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_mapScene->spanItems(m_zoomLevel, m_sceneCoordinate, m_viewSize);
+ /// @todo removed m_friendItemsHandler->refactorFriendItems(m_zoomLevel);
+}
+
void MapEngine::getTiles(QPoint sceneCoordinate)
{
qDebug() << __PRETTY_FUNCTION__;
qDebug() << __PRETTY_FUNCTION__;
m_gpsLocationItem->updatePosition(convertLatLonToSceneCoordinate(position), accuracy);
+ m_mapScene->spanItems(m_zoomLevel, m_sceneCoordinate, m_viewSize);
if (m_autoCenteringEnabled)
setViewLocation(position);
else {
m_ownLocation->hide();
}
+
+ m_mapScene->spanItems(m_zoomLevel, m_sceneCoordinate, m_viewSize);
}
QGraphicsScene* MapEngine::scene()
else if (sceneCoordinate.x() > WORLD_PIXELS_X - 1)
sceneCoordinate.setX(sceneCoordinate.x() - WORLD_PIXELS_X);
- if (sceneCoordinate.x() > m_sceneCoordinate.x())
- m_scrollDirection = SCROLL_EAST;
- else
- m_scrollDirection = SCROLL_WEST;
-
if (disableAutoCentering(sceneCoordinate))
emit mapScrolledManually();
m_mapScene->removeOutOfViewTiles(m_viewTilesGrid, m_zoomLevel);
}
- m_mapScene->spanItems(m_scrollDirection, m_zoomLevel, m_sceneCoordinate, m_viewSize);
+ m_mapScene->spanItems(m_zoomLevel, m_sceneCoordinate, m_viewSize);
}
void MapEngine::setZoomLevel(int newZoomLevel)
m_mapScene->setTilesDrawingLevels(m_zoomLevel);
getTiles(m_sceneCoordinate);
m_mapScene->setSceneVerticalOverlap(m_viewSize.height(), m_zoomLevel);
+ /// @todo remove m_friendItemsHandler->refactorFriendItems(m_zoomLevel);
+ m_mapScene->spanItems(m_zoomLevel, m_sceneCoordinate, m_viewSize);
}
void MapEngine::zoomIn()