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 af9f432 commit 9c76c07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/geometry/qgsinternalgeometryengine.cpp
Expand Up @@ -525,6 +525,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 9c76c07

Please sign in to comment.