Skip to content
Permalink
Browse files

Set the correct expression context for QgsHighlight

Fixes #17896
  • Loading branch information
nyalldawson committed Feb 5, 2018
1 parent 325af48 commit 535de3b1b229724a35fd63387f72f02f6550ccfd
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/gui/qgshighlight.cpp
@@ -321,6 +321,8 @@ void QgsHighlight::paint( QPainter *p )
return;
QgsMapSettings mapSettings = mMapCanvas->mapSettings();
QgsRenderContext context = QgsRenderContext::fromMapSettings( mapSettings );
context.expressionContext() << QgsExpressionContextUtils::layerScope( mLayer );


// Because lower level outlines must be covered by upper level fill color
// we render first with temporary opaque color, which is then replaced
@@ -341,6 +343,7 @@ void QgsHighlight::paint( QPainter *p )
context.setPainter( &imagePainter );

renderer->startRender( context, layer->fields() );
context.expressionContext().setFeature( mFeature );
renderer->renderFeature( mFeature, context );
renderer->stopRender( context );

0 comments on commit 535de3b

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