Skip to content

Commit

Permalink
Fix new annotations are shown even when annotations are hidden
Browse files Browse the repository at this point in the history
Fixes #19117
  • Loading branch information
nyalldawson committed Sep 24, 2018
1 parent 7466544 commit f9f683d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/gui/qgsmapcanvasannotationitem.cpp
Expand Up @@ -120,13 +120,20 @@ void QgsMapCanvasAnnotationItem::updateBoundingRect()

void QgsMapCanvasAnnotationItem::onCanvasLayersChanged()
{
if ( !mAnnotation->mapLayer() )
if ( !mMapCanvas->annotationsVisible() )
{
setVisible( true );
setVisible( false );
}
else
{
setVisible( mMapCanvas->mapSettings().layers().contains( mAnnotation->mapLayer() ) );
if ( !mAnnotation->mapLayer() )
{
setVisible( true );
}
else
{
setVisible( mMapCanvas->mapSettings().layers().contains( mAnnotation->mapLayer() ) );
}
}
}

Expand Down

0 comments on commit f9f683d

Please sign in to comment.