Skip to content

Commit 5584c53

Browse files
committed
Correctly add newly created annotations to manager
1 parent ad184cd commit 5584c53

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/app/qgsmaptoolannotation.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ void QgsMapToolAnnotation::canvasPressEvent( QgsMapMouseEvent* e )
127127
e->posF().y() / mCanvas->height() ) );
128128
annotation->setFrameSize( QSizeF( 200, 100 ) );
129129

130-
QgsMapCanvasAnnotationItem* canvasItem = new QgsMapCanvasAnnotationItem( annotation, mCanvas );
131-
canvasItem->setSelected( true );
132-
QgsProject::instance()->setDirty( true );
130+
QgsProject::instance()->annotationManager()->addAnnotation( annotation );
133131
}
134132
}
135133
}

0 commit comments

Comments
 (0)