Skip to content
Permalink
Browse files

Fix invisble annotations are still rendered

Fixes #17763
  • Loading branch information
nyalldawson committed Jan 3, 2018
1 parent 230e91c commit a4147b7a382771ca2a015f978e419ec50a7613ab
Showing with 8 additions and 2 deletions.
  1. +3 −0 src/gui/qgsmapcanvasannotationitem.cpp
  2. +5 −2 src/server/services/wms/qgswmsrenderer.cpp
@@ -287,6 +287,9 @@ double QgsMapCanvasAnnotationItem::scaledSymbolSize() const

void QgsMapCanvasAnnotationItem::paint( QPainter *painter )
{
if ( !mAnnotation || !mAnnotation->isVisible() )
return;

QgsRenderContext rc = QgsRenderContext::fromQPainter( painter );
rc.setFlag( QgsRenderContext::Antialiasing, true );

@@ -2806,11 +2806,14 @@ namespace QgsWms
void QgsRenderer::annotationsRendering( QPainter *painter ) const
{
const QgsAnnotationManager *annotationManager = mProject->annotationManager();
QList< QgsAnnotation * > annotations = annotationManager->annotations();
const QList< QgsAnnotation * > annotations = annotationManager->annotations();

QgsRenderContext renderContext = QgsRenderContext::fromQPainter( painter );
Q_FOREACH ( QgsAnnotation *annotation, annotations )
for ( QgsAnnotation *annotation : annotations )
{
if ( !annotation || !annotation->isVisible() )
continue;

annotation->render( renderContext );
}
}

0 comments on commit a4147b7

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