From 2ae4fecaeabb1083ac23632f870ccd08d21c7495 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 25 Sep 2020 22:15:22 +0100 Subject: [PATCH] Paste items into group when group has been "entered". --- pcbnew/tools/edit_tool.cpp | 4 +++- pcbnew/tools/pcbnew_control.cpp | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index decfa2a429..53ec8278f1 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -60,7 +60,8 @@ using namespace std::placeholders; #include -void EditToolSelectionFilter( GENERAL_COLLECTOR& aCollector, int aFlags, SELECTION_TOOL* selectionTool ) +void EditToolSelectionFilter( GENERAL_COLLECTOR& aCollector, int aFlags, + SELECTION_TOOL* selectionTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -112,6 +113,7 @@ void EditToolSelectionFilter( GENERAL_COLLECTOR& aCollector, int aFlags, SELECTI aCollector.Remove( item ); } } + selectionTool->FilterCollectorForGroups( aCollector ); } diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index e5e93bb82e..d4810aaa29 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -849,6 +849,11 @@ int PCBNEW_CONTROL::placeBoardItems( std::vector& aItems, bool aIsN { static_cast( item )->SetPath( KIID_PATH() ); } + + if( selectionTool->GetEnteredGroup() && !item->GetParentGroup() ) + { + selectionTool->GetEnteredGroup()->AddItem( item ); + } } // Add or just select items for the move/place command