pcbnew: Restore missing pad size

After adjusting the pad size, we need to restore it when we
short-circuit the drawing routine

Fixes https://gitlab.com/kicad/code/kicad/issues/5702
This commit is contained in:
Seth Hillbrand 2020-09-22 06:53:53 -07:00
parent 7656663a2f
commit 4a86daa86d
1 changed files with 9 additions and 3 deletions

View File

@ -889,10 +889,16 @@ 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;
// Once we change the size of the pad, check that there is still a pad remaining
if( !aPad->GetSize().x || !aPad->GetSize().y )
{
// Reset the stored pad size
if( aPad->GetSize() != pad_size )
const_cast<D_PAD*>( aPad )->SetSize( pad_size );
return;
}
const std::shared_ptr<SHAPE_COMPOUND> shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );