Fix edge case in arc collision.

SHAPE_ARC::IntersectLine() fails when one of the arcs start points
is on the center point of the other -- in this case we can't extend
the line to the arc intersection because one point does not define
a line....

Fixes https://gitlab.com/kicad/code/kicad/issues/12609
This commit is contained in:
Jeff Young 2022-10-09 23:03:29 +01:00
parent 35a14b8e5d
commit e5de56b6cc
1 changed files with 3 additions and 0 deletions

View File

@ -272,6 +272,9 @@ bool SHAPE_ARC::Collide( const SEG& aSeg, int aClearance, int* aActual, VECTOR2I
int SHAPE_ARC::IntersectLine( const SEG& aSeg, std::vector<VECTOR2I>* aIpsBuffer ) const
{
if( aSeg.A == aSeg.B ) // One point does not define a line....
return 0;
CIRCLE circ( GetCenter(), GetRadius() );
std::vector<VECTOR2I> intersections = circ.IntersectLine( aSeg );