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.
  • Loading branch information
nyalldawson committed Mar 29, 2018
1 parent f02602b commit 64707c181700ffafa06aaa3de0879d11e13b5408
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/gui/qgsmapcanvas.cpp
@@ -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 64707c1

Please sign in to comment.