Skip to content


Always add a dummy atlas expression context scope to canvas expression
Browse files Browse the repository at this point in the history

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.
  • Loading branch information
nyalldawson committed Mar 29, 2018
1 parent f02602b commit 64707c1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -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 );

Expand Down

0 comments on commit 64707c1

Please sign in to comment.