Skip to content

Commit

Permalink
Fix crash in arrow symbol layer
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 14, 2016
1 parent 9df87a6 commit 09b6d58
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/core/symbology-ng/qgsarrowsymbollayer.cpp
Expand Up @@ -762,13 +762,16 @@ void QgsArrowSymbolLayer::renderPolyline( const QPolygonF& points, QgsSymbolV2Re
{
_resolveDataDefined( context );

// origin point
QPointF po( points.at( 0 ) );
// destination point
QPointF pd( points.back() );
if ( !points.isEmpty() )
{
// origin point
QPointF po( points.at( 0 ) );
// destination point
QPointF pd( points.back() );

QPolygonF poly = straightArrow( po, pd, mScaledArrowStartWidth, mScaledArrowWidth, mScaledHeadWidth, mScaledHeadHeight, mComputedHeadType, mComputedArrowType, mScaledOffset );
mSymbol->renderPolygon( poly, /* rings */ nullptr, context.feature(), context.renderContext() );
QPolygonF poly = straightArrow( po, pd, mScaledArrowStartWidth, mScaledArrowWidth, mScaledHeadWidth, mScaledHeadHeight, mComputedHeadType, mComputedArrowType, mScaledOffset );
mSymbol->renderPolygon( poly, /* rings */ nullptr, context.feature(), context.renderContext() );
}
}
else
{
Expand Down

0 comments on commit 09b6d58

Please sign in to comment.