Skip to content

Commit

Permalink
Fix incorrect 'left of' calculation when finding nearest point
Browse files Browse the repository at this point in the history
to circular string
  • Loading branch information
nyalldawson committed Sep 19, 2017
1 parent fd3a38f commit e5b1c67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/geometry/qgscircularstring.cpp
Expand Up @@ -873,7 +873,8 @@ double QgsCircularString::closestPointOnArc( double x1, double y1, double x2, do

if ( leftOf )
{
*leftOf = clockwise ? sqrDistance > radius : sqrDistance < radius;
double sqrDistancePointToCenter = ( pt.x() - centerX ) * ( pt.x() - centerX ) + ( pt.y() - centerY ) * ( pt.y() - centerY );
*leftOf = clockwise ? sqrDistancePointToCenter > radius * radius : sqrDistancePointToCenter < radius * radius;
}

return sqrDistance;
Expand Down

0 comments on commit e5b1c67

Please sign in to comment.