Skip to content
Permalink
Browse files

Fix incorrect 'left of' calculation when finding nearest point

to circular string
  • Loading branch information
nyalldawson committed Sep 19, 2017
1 parent fd3a38f commit e5b1c67594fcfd96e54fd09f7cd7998bc29849eb
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/geometry/qgscircularstring.cpp
@@ -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;

0 comments on commit e5b1c67

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