Skip to content

Commit

Permalink
Ensure main annotation layer for project has a CRS assigned too
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 22, 2021
1 parent 524c431 commit 8af1fae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/project/qgsproject.cpp
Expand Up @@ -751,6 +751,12 @@ void QgsProject::setCrs( const QgsCoordinateReferenceSystem &crs, bool adjustEll
mCrs = crs;
writeEntry( QStringLiteral( "SpatialRefSys" ), QStringLiteral( "/ProjectionsEnabled" ), crs.isValid() ? 1 : 0 );
mProjectScope.reset();

// if annotation layer doesn't have a crs (i.e. in a newly created project), it should
// initially inherit the project CRS
if ( !mMainAnnotationLayer->crs().isValid() )
mMainAnnotationLayer->setCrs( crs );

setDirty( true );
emit crsChanged();
}
Expand Down

0 comments on commit 8af1fae

Please sign in to comment.