Ungroup before deleting items.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20699
This commit is contained in:
Jeff Young 2025-05-03 21:16:26 +01:00
parent 6490ffb9b7
commit 3f25b36ff1

View File

@ -134,7 +134,12 @@ void DIALOG_GLOBAL_DELETION::DoGlobalDeletions()
[&]( BOARD_ITEM* item, const LSET& layers_mask )
{
if( ( item->GetLayerSet() & layers_mask ).any() )
{
if( item->GetParentGroup() )
commit.Stage( item, CHT_UNGROUP );
commit.Remove( item );
}
};
auto processConnectedItem =
@ -142,6 +147,9 @@ void DIALOG_GLOBAL_DELETION::DoGlobalDeletions()
{
if( ( item->GetLayerSet() & layers_mask ).any() )
{
if( item->GetParentGroup() )
commit.Stage( item, CHT_UNGROUP );
commit.Remove( item );
gen_rastnest = true;
}