Skip to content
Permalink
Browse files
Fix crash in labeling if label has data defined x/y set and projectio…
…n error occurs transforming these coordinates
  • Loading branch information
nyalldawson committed Jun 14, 2021
1 parent c82678d commit 4a50d8791660e8eac5c0ac33b3183a190b3e5256
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/core/labeling/qgspallabeling.cpp
@@ -2379,8 +2379,11 @@ void QgsPalLayerSettings::registerFeature( const QgsFeature &f, QgsRenderContext
if ( QgsPalLabeling::geometryRequiresPreparation( ddPoint, context, ct ) )
{
ddPoint = QgsPalLabeling::prepareGeometry( ddPoint, context, ct );
xPos = static_cast< const QgsPoint * >( ddPoint.constGet() )->x();
yPos = static_cast< const QgsPoint * >( ddPoint.constGet() )->y();
if ( const QgsPoint *point = qgsgeometry_cast< const QgsPoint * >( ddPoint.constGet() ) )
{
xPos = point->x();
yPos = point->y();
}
}

anchorPosition = QgsPointXY( xPos, yPos );

0 comments on commit 4a50d87

Please sign in to comment.