Use point collision test for zero-length segments
SEG::SquaredDistance( SEG& ) does not do the right thing for segments with zero length at the moment. Fixes https://gitlab.com/kicad/code/kicad/-/issues/9791
This commit is contained in:
parent
bf3877a399
commit
0570c22732
|
@ -78,6 +78,9 @@ public:
|
||||||
bool Collide( const SEG& aSeg, int aClearance = 0, int* aActual = nullptr,
|
bool Collide( const SEG& aSeg, int aClearance = 0, int* aActual = nullptr,
|
||||||
VECTOR2I* aLocation = nullptr ) const override
|
VECTOR2I* aLocation = nullptr ) const override
|
||||||
{
|
{
|
||||||
|
if( aSeg.A == aSeg.B )
|
||||||
|
return Collide( aSeg.A, aClearance, aActual, aLocation );
|
||||||
|
|
||||||
int min_dist = ( m_width + 1 ) / 2 + aClearance;
|
int min_dist = ( m_width + 1 ) / 2 + aClearance;
|
||||||
ecoord dist_sq = m_seg.SquaredDistance( aSeg );
|
ecoord dist_sq = m_seg.SquaredDistance( aSeg );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue