Skip to content

Commit

Permalink
If composer map is set to use project CRS, update cached render
Browse files Browse the repository at this point in the history
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.
10 changes: 10 additions & 0 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -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 );
}
Expand Down

0 comments on commit c5566e7

Please sign in to comment.