Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix possible crash when rendering callouts (master only)
- Loading branch information
Showing
with
6 additions
and
0 deletions.
-
+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() ); |
|
|