Fix SHAPE_ARC::BBox() and Collide() to honour m_width.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16951
This commit is contained in:
Jeff Young 2024-02-12 16:59:28 +00:00
parent 7e4e80a2e5
commit d5ac0ff768
1 changed files with 5 additions and 1 deletions

View File

@ -244,6 +244,7 @@ bool SHAPE_ARC::Collide( const SEG& aSeg, int aClearance, int* aActual, VECTOR2I
if( aSeg.A == aSeg.B )
return Collide( aSeg.A, aClearance, aActual, aLocation );
int minDist = aClearance + m_width / 2;
VECTOR2I center = GetCenter();
CIRCLE circle( center, GetRadius() );
@ -263,7 +264,7 @@ bool SHAPE_ARC::Collide( const SEG& aSeg, int aClearance, int* aActual, VECTOR2I
for( const VECTOR2I& candidate : candidatePts )
{
if( Collide( candidate, aClearance, aActual, aLocation ) )
if( Collide( candidate, minDist, aActual, aLocation ) )
return true;
}
@ -357,6 +358,9 @@ const BOX2I SHAPE_ARC::BBox( int aClearance ) const
{
BOX2I bbox( m_bbox );
if( m_width != 0 )
bbox.Inflate( KiROUND( m_width / 2.0 ) + 1 );
if( aClearance != 0 )
bbox.Inflate( aClearance );