pcb_painter.cpp: fix incorrect shape of CHAMFERED_RECT pads with negative clearance.

Negative clearance (for instance on mask or paste layer) was not taken in account
This commit is contained in:
jean-pierre charras 2021-06-21 18:52:57 +02:00
parent 00b4134eb8
commit 9fb77473cd
1 changed files with 18 additions and 1 deletions

View File

@ -1149,6 +1149,23 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
case SH_SIMPLE:
{
const SHAPE_SIMPLE* poly = static_cast<const SHAPE_SIMPLE*>( shape );
if( margin.x < 0 ) // The poly shape must be deflated
{
int maxError = bds.m_MaxError;
int numSegs = GetArcToSegmentCount( -margin.x, maxError, 360.0 );
SHAPE_POLY_SET outline;
outline.NewOutline();
for( int ii = 0; ii < poly->PointCount(); ++ii )
outline.Append( poly->CPoint( ii ) );
outline.Deflate( -margin.x, numSegs );
m_gal->DrawPolygon( outline );
}
else
m_gal->DrawPolygon( poly->Vertices() );
// Now add on a rounded margin (using segments) if the margin > 0