Skip to content

Commit

Permalink
Fix orthogonalize
Browse files Browse the repository at this point in the history
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Aug 11, 2022
1 parent b8a7119 commit c2e2369
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/geometry/qgsinternalgeometryengine.cpp
Expand Up @@ -526,6 +526,10 @@ QgsVector calcMotion( const QgsPoint &a, const QgsPoint &b, const QgsPoint &c,
dotProduct += 1.0;

QgsVector new_v = p + q;
if ( qgsDoubleNear( new_v.length(), 0.0 ) )
{
return QgsVector( 0, 0 );
}
// 0.1 magic number from JOSM implementation - think this is to limit each iterative step
return new_v.normalized() * ( 0.1 * dotProduct * scale );
}
Expand Down

0 comments on commit c2e2369

Please sign in to comment.