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,9 +889,15 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
{ {
const_cast<D_PAD*>( aPad )->SetSize( pad_size + margin + margin ); const_cast<D_PAD*>( aPad )->SetSize( pad_size + margin + margin );
margin.x = margin.y = 0; margin.x = margin.y = 0;
}
// Once we change the size of the pad, check that there is still a pad remaining // Once we change the size of the pad, check that there is still a pad remaining
if( !aPad->GetSize().x || !aPad->GetSize().y ) 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; return;
} }