PNS: Don't clip the line in the middle of an arc - just start again
In shove mode, returning an empty line results in keeping the current head, which should be okay for now. Fixes https://gitlab.com/kicad/code/kicad/-/issues/9023
This commit is contained in:
parent
572747a3f9
commit
bbafce6ab3
|
@ -576,11 +576,27 @@ const LINE LINE::ClipToNearestObstacle( NODE* aNode ) const
|
|||
if( obs )
|
||||
{
|
||||
l.RemoveVia();
|
||||
int p = l.Line().Split( obs->m_ipFirst );
|
||||
VECTOR2I collisionPoint = obs->m_ipFirst;
|
||||
int segIdx = l.Line().NearestSegment( collisionPoint );
|
||||
|
||||
if( l.Line().IsArcSegment( segIdx ) )
|
||||
{
|
||||
// Don't clip at arcs, start again
|
||||
l.Line().Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
SEG nearestSegment = l.Line().CSegment( segIdx );
|
||||
VECTOR2I nearestPt = nearestSegment.NearestPoint( collisionPoint );
|
||||
int p = l.Line().Split( nearestPt );
|
||||
l.Line().Remove( p + 1, -1 );
|
||||
} else
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( i == IterationLimit )
|
||||
l.Line().Clear();
|
||||
|
|
Loading…
Reference in New Issue