Skip to content

Commit

Permalink
Fix compilation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
YoannQDQ authored and nyalldawson committed May 7, 2023
1 parent 3c3bfb8 commit 5837820
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/qgsmaptoolannotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ void QgsMapToolAnnotation::canvasPressEvent( QgsMapMouseEvent *e )
const QgsPointXY mapPos = transformCanvasToAnnotation( toMapCoordinates( e->pos() ), annotation );
annotation->setMapPosition( mapPos );
annotation->setMapPositionCrs( mCanvas->mapSettings().destinationCrs() );
annotation->setRelativePosition( QPointF( e->pos().x() / mCanvas->width(),
e->pos().y() / mCanvas->height() ) );
annotation->setRelativePosition( QPointF(
static_cast<double>( e->pos().x() ) / mCanvas->width(),
static_cast<double>( e->pos().y() ) / mCanvas->height() ) );
annotation->setFrameSizeMm( QSizeF( 50, 25 ) );

QgsProject::instance()->annotationManager()->addAnnotation( annotation );
Expand Down Expand Up @@ -173,7 +174,7 @@ bool QgsMapToolAnnotation::populateContextMenuWithEvent( QMenu *menu, QgsMapMous
dialog->exec();
}
} );
menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionDeleteSelected.svg" ) ), tr( "Delete" ), this, [this, existingItem]()
menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionDeleteSelected.svg" ) ), tr( "Delete" ), this, [existingItem]()
{
QgsProject::instance()->annotationManager()->removeAnnotation( existingItem->annotation() );
} );
Expand Down

0 comments on commit 5837820

Please sign in to comment.