Skip to content

Commit

Permalink
Add QgsRenderContext to QgsLayerTreeModelLegendNode::ItemContext
Browse files Browse the repository at this point in the history
  • Loading branch information
roya0045 authored and nyalldawson committed Jan 15, 2019
1 parent 773ee55 commit 004d6ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Expand Up @@ -76,6 +76,7 @@ Default implementation does nothing. *

struct ItemContext
{
QgsRenderContext *context;
QPainter *painter;
QPointF point;
double labelXOffset;
Expand Down
2 changes: 2 additions & 0 deletions src/core/layertree/qgslayertreemodellegendnode.h
Expand Up @@ -86,6 +86,8 @@ class CORE_EXPORT QgsLayerTreeModelLegendNode : public QObject

struct ItemContext
{
//! Render context, if available
QgsRenderContext *context = nullptr;
//! Painter
QPainter *painter = nullptr;
//! Top-left corner of the legend item
Expand Down
1 change: 1 addition & 0 deletions src/core/qgslegendrenderer.cpp
Expand Up @@ -536,6 +536,7 @@ QgsLegendRenderer::Nucleon QgsLegendRenderer::drawSymbolItem( QgsLayerTreeModelL
QgsLegendRenderer::Nucleon QgsLegendRenderer::drawSymbolItemInternal( QgsLayerTreeModelLegendNode *symbolItem, QgsRenderContext *context, QPainter *painter, QPointF point, double labelXOffset )
{
QgsLayerTreeModelLegendNode::ItemContext ctx;
ctx.context = context;
ctx.painter = context ? context->painter() : painter;
ctx.point = point;
ctx.labelXOffset = labelXOffset;
Expand Down

0 comments on commit 004d6ba

Please sign in to comment.