Add margin to both sides to avoid drawing 0-poly

We cannot draw degenerate polygons, so we need to test for 0-size shapes
especially after scaling the mask.  The mask adjustment is from both
sides however, so it needs to be doubled.

Fixes https://gitlab.com/kicad/code/kicad/issues/7020
This commit is contained in:
Seth Hillbrand 2021-01-09 12:42:08 -08:00
parent ffb3748cfc
commit 8036303f8f
1 changed files with 3 additions and 1 deletions

View File

@ -966,7 +966,9 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
// inflation along separate axes. So for those cases we build a dummy pad instead,
// and inflate it.
if( pad_size.x + margin.x <= 0 || pad_size.y + margin.y <= 0 )
// Margin is added to both sides. If the total margin is larger than the pad
// then don't display this layer
if( pad_size.x + 2 * margin.x <= 0 || pad_size.y + 2 * margin.y <= 0 )
return;
dummyPad.reset( static_cast<PAD*>( aPad->Duplicate() ) );