Avoid trying to draw empty pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/12605
This commit is contained in:
parent
72402cf687
commit
e866dfe137
|
@ -271,7 +271,7 @@ void CornerListToPolygon( SHAPE_POLY_SET& outline, std::vector<ROUNDED_CORNER>&
|
|||
endAngle = EDA_ANGLE( angle, RADIANS_T );
|
||||
}
|
||||
|
||||
if( aInflate )
|
||||
if( aInflate && tanAngle2 )
|
||||
{
|
||||
radius += aInflate;
|
||||
cornerPosition += incoming.Resize( aInflate / tanAngle2 )
|
||||
|
|
|
@ -1370,6 +1370,9 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
|||
{
|
||||
const SHAPE_SIMPLE* poly = static_cast<const SHAPE_SIMPLE*>( shape );
|
||||
|
||||
if( poly->PointCount() < 2 ) // Careful of empty pads
|
||||
break;
|
||||
|
||||
if( margin.x < 0 ) // The poly shape must be deflated
|
||||
{
|
||||
int numSegs = GetArcToSegmentCount( -margin.x, m_maxError, FULL_CIRCLE );
|
||||
|
@ -1469,7 +1472,9 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
|||
// Use ERROR_INSIDE because it avoids Clipper and is therefore much faster.
|
||||
aPad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ),
|
||||
clearance, m_maxError, ERROR_INSIDE );
|
||||
m_gal->DrawPolygon( polySet );
|
||||
|
||||
if( polySet.Outline( 0 ).PointCount() > 2 ) // Careful of empty pads
|
||||
m_gal->DrawPolygon( polySet );
|
||||
}
|
||||
}
|
||||
else if( aPad->GetEffectiveHoleShape() && clearance > 0 )
|
||||
|
|
Loading…
Reference in New Issue