Skip to content

Commit

Permalink
[layout] Add legend item scope to render context
Browse files Browse the repository at this point in the history
This enables us to render symbols differently in different legends

(cherry picked from commit c213c49)
  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 19, 2021
1 parent e760bee commit 163ee62
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/layout/qgslayoutitemlegend.cpp
Expand Up @@ -181,6 +181,8 @@ void QgsLayoutItemLegend::draw( QgsLayoutItemRenderContext &context )
QgsRenderContext rc = mMap ? QgsLayoutUtils::createRenderContextForMap( mMap, painter, context.renderContext().scaleFactor() * 25.4 )
: QgsLayoutUtils::createRenderContextForLayout( mLayout, painter, context.renderContext().scaleFactor() * 25.4 );

rc.expressionContext().appendScopes( createExpressionContext().takeScopes() );

QgsScopedQPainterState painterState( painter );

// painter is scaled to dots, so scale back to layout units
Expand Down

0 comments on commit 163ee62

Please sign in to comment.