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
Otherwise layers will be incorrectly cropped until the next full map refresh
  • Loading branch information
nyalldawson committed Nov 13, 2020
1 parent 60836b7 commit cf330fe
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() );

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

0 comments on commit cf330fe

Please sign in to comment.