From ec6bc85a29923431f975879cbaa13dcd5dbf920e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 9 Apr 2025 12:18:11 +0100 Subject: [PATCH] No requirement to UNGROUP when we're recording entire parent FP. Fixes https://gitlab.com/kicad/code/kicad/-/issues/20589 --- pcbnew/tools/edit_tool.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 24bd724513..b3fbf59a87 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -2495,7 +2495,7 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut ) BOARD_ITEM* board_item = static_cast( item ); FOOTPRINT* parentFP = board_item->GetParentFootprint(); - if( board_item->GetParentGroup() ) + if( board_item->GetParentGroup() && !parentFP ) commit.Stage( board_item, CHT_UNGROUP ); switch( item->Type() ) @@ -2522,6 +2522,16 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut ) } case PCB_TEXT_T: + case PCB_SHAPE_T: + case PCB_TEXTBOX_T: + case PCB_TABLE_T: + case PCB_REFERENCE_IMAGE_T: + case PCB_DIMENSION_T: + case PCB_DIM_ALIGNED_T: + case PCB_DIM_LEADER_T: + case PCB_DIM_CENTER_T: + case PCB_DIM_RADIAL_T: + case PCB_DIM_ORTHOGONAL_T: if( parentFP ) { commit.Modify( parentFP ); @@ -2536,20 +2546,6 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut ) itemsDeleted++; break; - case PCB_SHAPE_T: - case PCB_TEXTBOX_T: - case PCB_TABLE_T: - case PCB_REFERENCE_IMAGE_T: - case PCB_DIMENSION_T: - case PCB_DIM_ALIGNED_T: - case PCB_DIM_LEADER_T: - case PCB_DIM_CENTER_T: - case PCB_DIM_RADIAL_T: - case PCB_DIM_ORTHOGONAL_T: - commit.Remove( board_item ); - itemsDeleted++; - break; - case PCB_TABLECELL_T: // Clear contents of table cell commit.Modify( board_item );