Skip to content

Commit 2293973

Browse files
committed
[composer] Respect linked layer visibility when drawing annotation items (fix #10172)
1 parent 4058f47 commit 2293973

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/core/composer/qgscomposermap.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -1879,12 +1879,17 @@ void QgsComposerMap::drawAnnotations( QPainter* painter )
18791879
QgsRenderContext rc = QgsComposerUtils::createRenderContextForMap( this, painter );
18801880
rc.setForceVectorOutput( true );
18811881
rc.setExpressionContext( createExpressionContext() );
1882+
QList< QgsMapLayer* > layers = layersToRender( &rc.expressionContext() );
1883+
18821884
Q_FOREACH ( QgsAnnotation* annotation, annotations )
18831885
{
1884-
if ( !annotation )
1886+
if ( !annotation || !annotation->isVisible() )
18851887
{
18861888
continue;
18871889
}
1890+
if ( annotation->mapLayer() && !layers.contains( annotation->mapLayer() ) )
1891+
continue;
1892+
18881893
drawAnnotation( annotation, rc );
18891894
}
18901895
}

0 commit comments

Comments
 (0)