Skip to content

Commit 2c8bca7

Browse files
committed
Merge branch 'release-1_7_0' of github.com:qgis/Quantum-GIS into release-1_7_0
2 parents 6039882 + 3f60dc0 commit 2c8bca7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/core/symbology-ng/qgslinesymbollayerv2.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,15 @@ void QgsLineDecorationSymbolLayerV2::renderPolyline( const QPolygonF& points, Qg
639639
}
640640

641641
int cnt = points.count();
642-
QPointF p1 = points.at( cnt - 2 );
643-
QPointF p2 = points.at( cnt - 1 );
642+
QPointF p2 = points.at( --cnt );
643+
QPointF p1 = points.at( --cnt );
644+
while ( p2 == p1 && cnt )
645+
p1 = points.at( --cnt );
646+
if ( p1 == p2 ) {
647+
// this is a collapsed line... don't bother drawing an arrow
648+
// with arbitrary orientation
649+
return;
650+
}
644651

645652
double angle = atan2( p2.y() - p1.y(), p2.x() - p1.x() );
646653
double size = context.outputLineWidth( mWidth * 8 );

0 commit comments

Comments
 (0)