Fixed crash when pads have negative clearance

Fixes: lp:1663173
* https://bugs.launchpad.net/kicad/+bug/1663173
This commit is contained in:
Jean-Samuel Reynaud 2017-02-11 09:15:00 +01:00 committed by Maciej Suminski
parent 95794df088
commit 3ec6f1d33b
1 changed files with 14 additions and 6 deletions

View File

@ -724,9 +724,14 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
0.0, corner_radius, segmentToCircleCount );
if( m_pcbSettings.m_sketchMode[ITEM_GAL_LAYER( PADS_VISIBLE )] )
m_gal->DrawPolyline( polySet.Outline( 0 ) );
{
if( polySet.OutlineCount() > 0 )
m_gal->DrawPolyline( polySet.Outline( 0 ) );
}
else
{
m_gal->DrawPolygon( polySet );
}
break;
}
@ -774,11 +779,14 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
constexpr int SEGCOUNT = 64;
aPad->TransformShapeWithClearanceToPolygon( polySet, aPad->GetClearance(), SEGCOUNT, 1.0 );
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
m_gal->SetIsStroke( true );
m_gal->SetIsFill( false );
m_gal->SetStrokeColor( color );
m_gal->DrawPolyline( polySet.COutline( 0 ) );
if( polySet.OutlineCount() > 0 )
{
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
m_gal->SetIsStroke( true );
m_gal->SetIsFill( false );
m_gal->SetStrokeColor( color );
m_gal->DrawPolyline( polySet.COutline( 0 ) );
}
}
}