Skip to content

Commit

Permalink
when snapping to curved geometry use snapped point coordinates instead
Browse files Browse the repository at this point in the history
of returning interpolated point on a segment
  • Loading branch information
alexbruy authored and nyalldawson committed Sep 29, 2023
1 parent cf75df9 commit 9aa0600
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/qgspointlocator.h
Expand Up @@ -289,9 +289,13 @@ class CORE_EXPORT QgsPointLocator : public QObject
{
const QgsLineString line( geom.vertexAt( mVertexIndex ), geom.vertexAt( mVertexIndex + 1 ) );
point = QgsGeometryUtils::closestPoint( line, QgsPoint( snappedPoint ) );
if ( QgsWkbTypes::isCurvedType( mLayer->wkbType() ) )
{
point.setX( snappedPoint.x() );
point.setY( snappedPoint.y() );
}
}


if ( transform.isValid() )
{
try
Expand Down

0 comments on commit 9aa0600

Please sign in to comment.