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 github-actions[bot] committed Nov 2, 2021
1 parent 8c66a35 commit 77ef023
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 77ef023

Please sign in to comment.