Skip to content
Permalink
Browse files

Force a canvas redraw after rotating canvas to follow GPS direction

Otherwise layers will be incorrectly cropped until the next full map refresh
  • Loading branch information
nyalldawson committed Nov 13, 2020
1 parent 60836b7 commit cf330feb7df75b9aac08e5d759f74676629f1729
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/app/gps/qgsgpsinformationwidget.cpp
@@ -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();
}

0 comments on commit cf330fe

Please sign in to comment.
You can’t perform that action at this time.