From cf330feb7df75b9aac08e5d759f74676629f1729 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 13 Nov 2020 13:32:57 +1000 Subject: [PATCH] Force a canvas redraw after rotating canvas to follow GPS direction Otherwise layers will be incorrectly cropped until the next full map refresh --- src/app/gps/qgsgpsinformationwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/gps/qgsgpsinformationwidget.cpp b/src/app/gps/qgsgpsinformationwidget.cpp index 3e303fc6136c..00ec0a7e2067 100644 --- a/src/app/gps/qgsgpsinformationwidget.cpp +++ b/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(); }