Skip to content
Permalink
Browse files

[composer] Respect linked layer visibility when drawing annotation it…

…ems (fix #10172)
  • Loading branch information
nyalldawson committed Jan 30, 2017
1 parent 4058f47 commit 22939736f4d8be18613459646ab592d093323590
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/core/composer/qgscomposermap.cpp
@@ -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 );
}
}

0 comments on commit 2293973

Please sign in to comment.
You can’t perform that action at this time.