Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix invisble annotations are still rendered
- Loading branch information
|
@@ -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 ); |
|
|
} |
|
|
} |
|
|