Skip to content

Commit 8db086c

Browse files
committed
Fix problems with edge snapping with duplicated vertices present
1 parent c812e42 commit 8db086c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/core/qgspointlocator.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ static void addPolylineToEdgeData( QLinkedList<RTree::Data*>& edgeDataList, cons
125125
vertexIndex++;
126126
QgsPoint pt = pl[i];
127127

128+
if ( pt == lastPt )
129+
continue; // ignore duplicate vertices (not forming a proper edge)
130+
128131
bool edgeDirection = ( pt.x() < lastPt.x() && pt.y() < lastPt.y() ) || ( pt.x() > lastPt.x() && pt.y() > lastPt.y() );
129132
bool isReversed = pt.x() < lastPt.x() || ( pt.x() == lastPt.x() && lastPt.y() < pt.y() );
130133
double pLow[2], pHigh[2];

0 commit comments

Comments
 (0)