From 546ca186622ce2084039b378641d154cc4d9197b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 24 May 2024 19:23:37 +0100 Subject: [PATCH] Delete tuning patterns in Unroute Selected. Fixes https://gitlab.com/kicad/code/kicad/-/issues/18065 (cherry picked from commit a678d0d710c38ff64ed2e23fd582470c934b842d) --- pcbnew/tools/pcb_selection_tool.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index edfc3fa613..e144139931 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -1579,6 +1579,21 @@ void PCB_SELECTION_TOOL::selectAllConnectedTracks( } } + // Promote generated members to their PCB_GENERATOR parents + for( EDA_ITEM* item : m_selection ) + { + BOARD_ITEM* boardItem = dynamic_cast( item ); + PCB_GROUP* parent = boardItem ? boardItem->GetParentGroup() : nullptr; + + if( parent && parent->Type() == PCB_GENERATOR_T ) + { + unselect( item ); + + if( !parent->IsSelected() ) + select( parent ); + } + } + for( BOARD_CONNECTED_ITEM* item : cleanupItems ) item->ClearFlags( SKIP_STRUCT ); }