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,10 +576,26 @@ const LINE LINE::ClipToNearestObstacle( NODE* aNode ) const
|
||||||
if( obs )
|
if( obs )
|
||||||
{
|
{
|
||||||
l.RemoveVia();
|
l.RemoveVia();
|
||||||
int p = l.Line().Split( obs->m_ipFirst );
|
VECTOR2I collisionPoint = obs->m_ipFirst;
|
||||||
l.Line().Remove( p + 1, -1 );
|
int segIdx = l.Line().NearestSegment( collisionPoint );
|
||||||
} else
|
|
||||||
|
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
|
||||||
|
{
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( i == IterationLimit )
|
if( i == IterationLimit )
|
||||||
|
|
Loading…
Reference in New Issue