Skip to content

Commit

Permalink
Fix problems with edge snapping with duplicated vertices present
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jan 20, 2015
1 parent c812e42 commit 8db086c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/qgspointlocator.cpp
Expand Up @@ -125,6 +125,9 @@ static void addPolylineToEdgeData( QLinkedList<RTree::Data*>& edgeDataList, cons
vertexIndex++;
QgsPoint pt = pl[i];

if ( pt == lastPt )
continue; // ignore duplicate vertices (not forming a proper edge)

bool edgeDirection = ( pt.x() < lastPt.x() && pt.y() < lastPt.y() ) || ( pt.x() > lastPt.x() && pt.y() > lastPt.y() );
bool isReversed = pt.x() < lastPt.x() || ( pt.x() == lastPt.x() && lastPt.y() < pt.y() );
double pLow[2], pHigh[2];
Expand Down

0 comments on commit 8db086c

Please sign in to comment.