Skip to content
Browse files
Always add a dummy atlas expression context scope to canvas expression

This allows the atlas variables to be correctly available before
an atlas has been first opened - e.g. for rules which render
when a feature is not the current atlas feature.

Otherwise these variables are NULL, which creates confusing behavior
when rendering differences occur before/after an atlas is opened.

(cherry-picked from 64707c)
  • Loading branch information
nyalldawson committed Apr 2, 2018
1 parent e863dc6 commit 94b7c88
Showing 1 changed file with 1 addition and 0 deletions.
@@ -499,6 +499,7 @@ void QgsMapCanvas::refreshMap()
QgsExpressionContext expressionContext;
expressionContext << QgsExpressionContextUtils::globalScope()
<< QgsExpressionContextUtils::projectScope( QgsProject::instance() )
<< QgsExpressionContextUtils::atlasScope( nullptr )
<< QgsExpressionContextUtils::mapSettingsScope( mSettings )
<< new QgsExpressionContextScope( mExpressionContextScope );

0 comments on commit 94b7c88

Please sign in to comment.