PCB_GENERATOR_Ts are PCB_GROUP_Ts too.

Also, an item must already be in a commit to add it to a group.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17595
This commit is contained in:
Jeff Young
2024-06-05 10:51:24 +01:00
parent 944835eefc
commit 9fb07d886e
2 changed files with 3 additions and 22 deletions
+1 -19
View File
@@ -291,7 +291,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
}
}
if( boardItem->Type() == PCB_GROUP_T )
if( boardItem->Type() == PCB_GROUP_T || boardItem->Type() == PCB_GENERATOR_T )
addedGroup = static_cast<PCB_GROUP*>( boardItem );
if( m_isBoardEditor && autofillZones && boardItem->Type() != PCB_MARKER_T )
@@ -352,24 +352,6 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
case PCB_MARKER_T: // a marker used to show something
case PCB_ZONE_T:
case PCB_FOOTPRINT_T:
if( view )
view->Remove( boardItem );
if( !( changeFlags & CHT_DONE ) )
{
if( parentFP )
{
parentFP->Remove( boardItem );
}
else
{
board->Remove( boardItem, REMOVE_MODE::BULK );
bulkRemovedItems.push_back( boardItem );
}
}
break;
case PCB_GROUP_T:
if( view )
view->Remove( boardItem );