From 8036303f8f5bdd2f3d00db69cd9dc9fc1f546589 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 9 Jan 2021 12:42:08 -0800 Subject: [PATCH] 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 --- pcbnew/pcb_painter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index ba78968f4d..e751f353af 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -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( aPad->Duplicate() ) );