Navigation Menu

Skip to content

Commit

Permalink
[composer] Respect linked layer visibility when drawing annotation it…
Browse files Browse the repository at this point in the history
…ems (fix #10172)
  • Loading branch information
nyalldawson committed Jan 30, 2017
1 parent 4058f47 commit 2293973
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/composer/qgscomposermap.cpp
Expand Up @@ -1879,12 +1879,17 @@ void QgsComposerMap::drawAnnotations( QPainter* painter )
QgsRenderContext rc = QgsComposerUtils::createRenderContextForMap( this, painter );
rc.setForceVectorOutput( true );
rc.setExpressionContext( createExpressionContext() );
QList< QgsMapLayer* > layers = layersToRender( &rc.expressionContext() );

Q_FOREACH ( QgsAnnotation* annotation, annotations )
{
if ( !annotation )
if ( !annotation || !annotation->isVisible() )
{
continue;
}
if ( annotation->mapLayer() && !layers.contains( annotation->mapLayer() ) )
continue;

drawAnnotation( annotation, rc );
}
}
Expand Down

0 comments on commit 2293973

Please sign in to comment.