Skip to content
Permalink
Browse files

Fix wrong arrow orientation when lines end with duplicated points (#3837

)
  • Loading branch information
Sandro Santilli authored and jef-n committed May 24, 2011
1 parent 28ad8f2 commit ef981f19a3e0676a2e0b78412eadf213794b7eb1
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/core/symbology-ng/qgslinesymbollayerv2.cpp
@@ -641,8 +641,15 @@ void QgsLineDecorationSymbolLayerV2::renderPolyline( const QPolygonF& points, Qg
}

int cnt = points.count();
QPointF p1 = points.at( cnt - 2 );
QPointF p2 = points.at( cnt - 1 );
QPointF p2 = points.at( --cnt );
QPointF p1 = points.at( --cnt );
while ( p2 == p1 && cnt )
p1 = points.at( --cnt );
if ( p1 == p2 ) {
// this is a collapsed line... don't bother drawing an arrow
// with arbitrary orientation
return;
}

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

0 comments on commit ef981f1

Please sign in to comment.
You can’t perform that action at this time.