Skip to content

Commit 9fcc130

Browse files
committedFeb 1, 2017
Catch transform errors for annotations
1 parent 1e5a93b commit 9fcc130

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎src/gui/qgsmapcanvasannotationitem.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ void QgsMapCanvasAnnotationItem::updatePosition()
5757
if ( mAnnotation->hasFixedMapPosition() )
5858
{
5959
QgsCoordinateTransform t( mAnnotation->mapPositionCrs(), mMapCanvas->mapSettings().destinationCrs() );
60-
setPos( toCanvasCoordinates( t.transform( mAnnotation->mapPosition() ) ) );
60+
QgsPoint coord = mAnnotation->mapPosition();
61+
try
62+
{
63+
coord = t.transform( coord );
64+
}
65+
catch ( QgsCsException& )
66+
{}
67+
setPos( toCanvasCoordinates( coord ) );
6168
}
6269
else
6370
{

0 commit comments

Comments
 (0)
Please sign in to comment.