Skip to content

Commit bf8571d

Browse files
committedJan 10, 2016
[tracer] Skip duplicate points in the path (to avoid geometry errors)
1 parent 70c5fe5 commit bf8571d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

‎src/core/qgstracer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ void extract_linework( QgsGeometry* g, QgsMultiPolyline& mpl )
444444
}
445445
}
446446

447-
448447
// -------------
449448

450449

‎src/gui/qgsmaptoolcapture.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ bool QgsMapToolCapture::tracingAddVertex( const QgsPoint& point )
208208

209209
for ( int i = 1; i < points.count(); ++i )
210210
{
211+
if ( points[i] == points[i-1] )
212+
continue; // avoid duplicate vertices if there are any
211213
mRubberBand->addPoint( points[i], i == points.count() - 1 );
212214
mCaptureCurve.addVertex( layerPoints[i-1] );
213215
}

0 commit comments

Comments
 (0)
Please sign in to comment.