We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4058f47 commit 2293973Copy full SHA for 2293973
src/core/composer/qgscomposermap.cpp
@@ -1879,12 +1879,17 @@ void QgsComposerMap::drawAnnotations( QPainter* painter )
1879
QgsRenderContext rc = QgsComposerUtils::createRenderContextForMap( this, painter );
1880
rc.setForceVectorOutput( true );
1881
rc.setExpressionContext( createExpressionContext() );
1882
+ QList< QgsMapLayer* > layers = layersToRender( &rc.expressionContext() );
1883
+
1884
Q_FOREACH ( QgsAnnotation* annotation, annotations )
1885
{
- if ( !annotation )
1886
+ if ( !annotation || !annotation->isVisible() )
1887
1888
continue;
1889
}
1890
+ if ( annotation->mapLayer() && !layers.contains( annotation->mapLayer() ) )
1891
+ continue;
1892
1893
drawAnnotation( annotation, rc );
1894
1895
0 commit comments