Skip to content
Permalink
Browse files

More tweaks to leftOf logic

  • Loading branch information
nyalldawson committed Nov 29, 2017
1 parent ebe16f1 commit b8a62f4f4d204a9c6c037dfa0ff721fd232c079d
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/geometry/qgslinestring.cpp
@@ -943,7 +943,7 @@ double QgsLineString::closestSegment( const QgsPoint &pt, QgsPoint &segmentPt,
// where we can perform the check
if ( left != 0 )
{
if ( qgsDoubleNear( testDist, leftOfDist ) && ( left < 0 ) != prevLeftOf )
if ( qgsDoubleNear( testDist, leftOfDist ) && left != prevLeftOf && prevLeftOf != 0 )
{
// we have two possible segments each with equal distance to point, but they disagree
// on whether or not the point is to the left of them.
@@ -964,6 +964,7 @@ double QgsLineString::closestSegment( const QgsPoint &pt, QgsPoint &segmentPt,
{
*leftOf = left;
leftOfDist = testDist;
prevLeftOf = 0;
}
}
}

0 comments on commit b8a62f4

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