summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjiban Bairagya <[email protected]>2016-06-16 10:09:12 +0200
committerSanjiban Bairagya <[email protected]>2016-06-16 10:14:01 +0200
commitd03d2483bae9220dfadbffd99c51f5b72d83f797 (patch)
treeecb103783a3ba1a0afca6620f2bd0d50d7166272
parent27fc53e50a20c6be0f71f252147ea5b488da5df1 (diff)
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
-rw-r--r--src/plugins/render/positionmarker/PositionMarker.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/render/positionmarker/PositionMarker.cpp b/src/plugins/render/positionmarker/PositionMarker.cpp
index da7bde6..f80e423 100644
--- a/src/plugins/render/positionmarker/PositionMarker.cpp
+++ b/src/plugins/render/positionmarker/PositionMarker.cpp
@@ -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;