Skip to content
Permalink
Browse files

Fix possible crash when rendering callouts (master only)

  • Loading branch information
nyalldawson committed Mar 18, 2021
1 parent 6909b45 commit cfde40dfef745f3553ffb8c9c9485d6479fe480a
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/callouts/qgscallout.cpp
@@ -652,6 +652,9 @@ void QgsSimpleLineCallout::draw( QgsRenderContext &context, QRectF rect, const d

const QPolygonF points = line.asQPolygonF();

if ( points.empty() )
return;

QgsCalloutPosition position;
position.setOrigin( context.mapToPixel().toMapCoordinates( points.at( 0 ).x(), points.at( 0 ).y() ).toQPointF() );
position.setDestination( context.mapToPixel().toMapCoordinates( points.constLast().x(), points.constLast().y() ).toQPointF() );
@@ -771,6 +774,9 @@ void QgsManhattanLineCallout::draw( QgsRenderContext &context, QRectF rect, cons

const QPolygonF points = line.asQPolygonF();

if ( points.empty() )
return;

QgsCalloutPosition position;
position.setOrigin( context.mapToPixel().toMapCoordinates( points.at( 0 ).x(), points.at( 0 ).y() ).toQPointF() );
position.setDestination( context.mapToPixel().toMapCoordinates( points.constLast().x(), points.constLast().y() ).toQPointF() );

0 comments on commit cfde40d

Please sign in to comment.