router: Match segment endpoint calculation between dragger and the tool.

Prevents always picking point A when dragging short segments.
This commit is contained in:
Alex 2022-12-21 20:55:41 +03:00
parent 7abfa46531
commit e8f755c665
1 changed files with 4 additions and 6 deletions

View File

@ -124,14 +124,12 @@ bool DRAGGER::startDragSegment( const VECTOR2D& aP, SEGMENT* aSeg )
auto distA = ( aP - aSeg->Seg().A ).EuclideanNorm();
auto distB = ( aP - aSeg->Seg().B ).EuclideanNorm();
if( distA <= w2 )
if( distA < w2 || distB < w2 )
{
m_mode = DM_CORNER;
}
else if( distB <= w2 )
{
m_draggedSegmentIndex++;
m_mode = DM_CORNER;
if( distB <= distA )
m_draggedSegmentIndex++;
}
else if( m_freeAngleMode )
{