Add newly-drawn objects to any entered group.

Fixes https://gitlab.com/kicad/code/kicad/issues/11912
This commit is contained in:
Jeff Young 2022-07-07 19:17:06 -06:00
parent 8a9bf02b7e
commit 654740b90d
2 changed files with 6 additions and 0 deletions

View File

@ -230,6 +230,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
{
case CHT_ADD:
{
if( selTool->GetEnteredGroup() && !boardItem->GetParentGroup() )
selTool->GetEnteredGroup()->AddItem( boardItem );
if( m_isFootprintEditor )
{
// footprints inside footprints are not supported yet

View File

@ -985,6 +985,9 @@ int PCB_CONTROL::placeBoardItems( std::vector<BOARD_ITEM*>& aItems, bool aIsNew,
{
const_cast<KIID&>( item->m_Uuid ) = KIID();
// Even though BOARD_COMMIT::Push() will add any new items to the group, we're
// going to run PCB_ACTIONS::move first, and the move tool will throw out any
// items that aren't in the entered group.
if( selectionTool->GetEnteredGroup() && !item->GetParentGroup() )
selectionTool->GetEnteredGroup()->AddItem( item );
}