Ensure that we had a pad remaining before painting

Null polygons should not be send to the painter, so we need to check to
see if our mask has removed the complete pad before painting

Fixes https://gitlab.com/kicad/code/kicad/issues/5702
This commit is contained in:
Seth Hillbrand 2020-09-18 22:32:22 -07:00
parent 375f1b8129
commit 23f7ba6ee4
1 changed files with 4 additions and 0 deletions

View File

@ -889,6 +889,10 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
{
const_cast<D_PAD*>( aPad )->SetSize( pad_size + margin + margin );
margin.x = margin.y = 0;
// Once we change the size of the pad, check that there is still a pad remaining
if( !aPad->GetSize().x || !aPad->GetSize().y )
return;
}
const std::shared_ptr<SHAPE_COMPOUND> shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );