Commit d03d2483 authored by Sanjiban Bairagya's avatar Sanjiban Bairagya Committed by Sanjiban Bairagya

Fix bug that the position marker was showing up on the

top-left corner of map when the marker stayed on the
not-visible region of globe during Route Simulation
parent 27fc53e5
......@@ -185,10 +185,14 @@ bool PositionMarker::render( GeoPainter *painter,
m_lastBoundingBox = viewport->viewLatLonAltBox();
qreal screenPositionX, screenPositionY;
viewport->screenCoordinates( m_currentPosition, screenPositionX, screenPositionY );
if (!viewport->screenCoordinates( m_currentPosition, screenPositionX, screenPositionY )){
return true;
}
const GeoDataCoordinates top( m_currentPosition.longitude(), m_currentPosition.latitude()+0.1 );
qreal screenTopX, screenTopY;
viewport->screenCoordinates( top, screenTopX, screenTopY );
if (!viewport->screenCoordinates( top, screenTopX, screenTopY )){
return true;
}
qreal const correction = -90.0 + RAD2DEG * atan2( screenPositionY -screenTopY, screenPositionX - screenTopX );
const qreal rotation = m_heading + correction;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment