PNS: Fix DP gateway generation when pad distance < gap

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9306
This commit is contained in:
Jon Evans 2021-11-27 14:03:08 -05:00
parent 152a583863
commit 8a0f8c329f
1 changed files with 4 additions and 10 deletions

View File

@ -496,19 +496,13 @@ void DP_GATEWAYS::BuildFromPrimitivePair( const DP_PRIMITIVE_PAIR& aPair, bool a
VECTOR2I dir, dp, dv;
if( k == 0 )
{
dir = makeGapVector( majorDirection, orthoFanDistance );
int d = ( padDist - m_gap );
dp = makeGapVector( dir, d );
dv = makeGapVector( p0_n - p0_p, d );
}
else
{
dir = makeGapVector( majorDirection, diagFanDistance );
int d = ( padDist - m_gap );
dp = makeGapVector( dir, d );
dv = makeGapVector( p0_n - p0_p, d );
}
int d = std::max( 0, padDist - m_gap );
dp = makeGapVector( dir, d );
dv = makeGapVector( p0_n - p0_p, d );
for( int i = 0; i < 2; i++ )
{