Skip to content
Permalink
Browse files

[layout] Add legend item scope to render context

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 163ee627b3d9d99b999d2127c89096d27fade4df
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/core/layout/qgslayoutitemlegend.cpp
@@ -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

0 comments on commit 163ee62

Please sign in to comment.