Skip to content
Permalink
Browse files
If composer map is set to use project CRS, update cached render
when project CRS changes

This should prevent one of the most common confusions with
composer maps - users inserting multiple maps, with apparently
different CRS due to outdated cache renders, and getting confused
because outputs from composer look different to the composer view....
  • Loading branch information
nyalldawson committed May 8, 2017
1 parent 5e3b903 commit c5566e7
Showing 1 changed file with 10 additions and 0 deletions.
@@ -1142,6 +1142,16 @@ void QgsComposerMap::connectUpdateSlot()
// redraws the map AFTER layers are removed
connect( project, &QgsProject::layersRemoved, this, &QgsComposerMap::renderModeUpdateCachedImage );
connect( project, &QgsProject::legendLayersAdded, this, &QgsComposerMap::renderModeUpdateCachedImage );

connect( project, &QgsProject::crsChanged, this, [ = ]
{
if ( !mCrs.isValid() )
{
//using project CRS, which just changed....
invalidateCache();
}
} );

}
connect( mComposition, &QgsComposition::refreshItemsTriggered, this, &QgsComposerMap::invalidateCache );
}

0 comments on commit c5566e7

Please sign in to comment.