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 9, 2021
1 parent 8f0a8dd commit 8943ac76d598f96c59d59a2ed530a972f07f89a1
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/core/labeling/qgspallabeling.cpp
@@ -2429,8 +2429,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 8943ac7

Please sign in to comment.