From f3c864c178b0488039285bab99d179420bfe23a9 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 (cherry picked from commit b06f90335b2106207f3d370935593703228cd4a2) --- 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 d4add45cb4..c0e38cfaf7 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -841,8 +841,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 ) ); @@ -859,8 +866,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;