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 authored and github-actions committed Jun 9, 2021
1 parent 607b44b commit caa795e428b2e046d4c86d7766b997cfdf1ed049
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 caa795e

Please sign in to comment.