Skip to content
Permalink
Browse files

Always add a dummy atlas expression context scope to canvas expression

context

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 94b7c88f289f3ad0687122071916d39fa7ea74ab
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 94b7c88

Please sign in to comment.
You can’t perform that action at this time.