From b06f90335b2106207f3d370935593703228cd4a2 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 7 May 2023 22:12:11 -0400 Subject: [PATCH] PNS: Remove holes when removing items with holes Related to https://gitlab.com/kicad/code/kicad/-/issues/14702 --- pcbnew/router/pns_node.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index 6a8e62549b..0544b9ba58 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -840,8 +840,15 @@ void NODE::Remove( ITEM* aItem ) break; case ITEM::SOLID_T: + { + SOLID* solid = static_cast( aItem ); + + if( solid->HasHole() ) + Remove( solid->Hole() ); + Remove( static_cast( aItem ) ); break; + } case ITEM::SEGMENT_T: Remove( static_cast( aItem ) ); @@ -858,8 +865,15 @@ void NODE::Remove( ITEM* aItem ) } case ITEM::VIA_T: + { + VIA* via = static_cast( aItem ); + + if( via->HasHole() ) + Remove( via->Hole() ); + Remove( static_cast( aItem ) ); break; + } default: break;