Skip to content
Permalink
Browse files

Fix new annotations are shown even when annotations are hidden

Fixes #19117
  • Loading branch information
nyalldawson committed Sep 24, 2018
1 parent 7466544 commit f9f683dbd01ec1ff273d7610b655e82841defb45
Showing with 10 additions and 3 deletions.
  1. +10 −3 src/gui/qgsmapcanvasannotationitem.cpp
@@ -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() ) );
}
}
}

0 comments on commit f9f683d

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