Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[layout] Add legend item scope to render context
This enables us to render symbols differently in different legends
  • Loading branch information
m-kuhn authored and github-actions[bot] committed Mar 7, 2021
1 parent 7c98adc commit c85c594
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 c85c594

Please sign in to comment.