Skip to content

Commit

Permalink
Force a canvas redraw after rotating canvas to follow GPS direction
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and nyalldawson committed Nov 13, 2020
1 parent e9539fd commit 0c16716
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/gps/qgsgpsinformationwidget.cpp
Expand Up @@ -1061,11 +1061,13 @@ void QgsGpsInformationWidget::displayGPSInformation( const QgsGpsInformation &in
bearingLine.setP2( wgs84ToCanvas.transform( res ).toQPointF() ); bearingLine.setP2( wgs84ToCanvas.transform( res ).toQPointF() );


mMapCanvas->setRotation( 270 - bearingLine.angle() ); mMapCanvas->setRotation( 270 - bearingLine.angle() );
mMapCanvas->refresh();
} }
catch ( QgsCsException & ) catch ( QgsCsException & )
{ {
QgsDebugMsg( QStringLiteral( "Coordinate exception encountered while calculating GPS bearing rotation" ) ); QgsDebugMsg( QStringLiteral( "Coordinate exception encountered while calculating GPS bearing rotation" ) );
mMapCanvas->setRotation( trueNorth - bearing - adjustment ); mMapCanvas->setRotation( trueNorth - bearing - adjustment );
mMapCanvas->refresh();
} }
mLastRotateTimer.restart(); mLastRotateTimer.restart();
} }
Expand Down

0 comments on commit 0c16716

Please sign in to comment.