Skip to content
Permalink
Browse files
Fix orthogonalize
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Aug 11, 2022
1 parent b8a7119 commit c2e23696dfa0f82caf499da01d3bbd55f4924b6c
Showing 1 changed file with 4 additions and 0 deletions.
@@ -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 );
}

0 comments on commit c2e2369

Please sign in to comment.