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 ); }