From 23f7ba6ee425244af9b7760a0287bb38b184bf22 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 18 Sep 2020 22:32:22 -0700 Subject: [PATCH] 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 --- pcbnew/pcb_painter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 59fd80382e..e14b269d03 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -889,6 +889,10 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) { const_cast( 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 shapes = std::dynamic_pointer_cast( aPad->GetEffectiveShape() );