Skip to content

Commit

Permalink
Fix invisble annotations are still rendered
Browse files Browse the repository at this point in the history
Fixes #17763
  • Loading branch information
nyalldawson committed Jan 3, 2018
1 parent 230e91c commit a4147b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/gui/qgsmapcanvasannotationitem.cpp
Expand Up @@ -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 );

Expand Down
7 changes: 5 additions & 2 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -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 );
}
}
Expand Down

0 comments on commit a4147b7

Please sign in to comment.