Skip to content

Commit

Permalink
Catch transform errors for annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 1, 2017
1 parent 1e5a93b commit 9fcc130
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gui/qgsmapcanvasannotationitem.cpp
Expand Up @@ -57,7 +57,14 @@ void QgsMapCanvasAnnotationItem::updatePosition()
if ( mAnnotation->hasFixedMapPosition() )
{
QgsCoordinateTransform t( mAnnotation->mapPositionCrs(), mMapCanvas->mapSettings().destinationCrs() );
setPos( toCanvasCoordinates( t.transform( mAnnotation->mapPosition() ) ) );
QgsPoint coord = mAnnotation->mapPosition();
try
{
coord = t.transform( coord );
}
catch ( QgsCsException& )
{}
setPos( toCanvasCoordinates( coord ) );
}
else
{
Expand Down

0 comments on commit 9fcc130

Please sign in to comment.