Skip to content

Commit

Permalink
Fix comparison with square tolerance also in QgsGeometryAngleCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent authored and nyalldawson committed Nov 3, 2021
1 parent 2726e15 commit 1b3002e
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -138,7 +138,7 @@ void QgsGeometryAngleCheck::fixError( const QMap<QString, QgsFeaturePool *> &fea
{
changes[error->layerId()][error->featureId()].append( Change( ChangeNode, ChangeRemoved, vidx ) );
// Avoid duplicate nodes as result of deleting spike vertex
if ( QgsGeometryUtils::sqrDistance2D( p1, p3 ) < mContext->tolerance &&
if ( QgsGeometryUtils::sqrDistance2D( p1, p3 ) < ( mContext->tolerance * mContext->tolerance ) &&
QgsGeometryCheckerUtils::canDeleteVertex( geometry, vidx.part, vidx.ring ) &&
geometry->deleteVertex( error->vidx() ) ) // error->vidx points to p3 after removing p2
{
Expand Down

0 comments on commit 1b3002e

Please sign in to comment.