diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 361a6bd92e..1a4dfadc0b 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -78,13 +78,16 @@ COMMIT& BOARD_COMMIT::Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType, BASE_SCRE // Many operations (move, rotate, etc.) are applied directly to a group's children, so they // must be staged as well. - if( PCB_GROUP* group = dynamic_cast( aItem ) ) + if( aChangeType == CHT_MODIFY ) { - group->RunOnChildren( - [&]( BOARD_ITEM* child ) - { - Stage( child, aChangeType ); - } ); + if( PCB_GROUP* group = dynamic_cast( aItem ) ) + { + group->RunOnChildren( + [&]( BOARD_ITEM* child ) + { + Stage( child, aChangeType ); + } ); + } } return COMMIT::Stage( aItem, aChangeType ); diff --git a/pcbnew/tools/group_tool.cpp b/pcbnew/tools/group_tool.cpp index 862d039950..9481124994 100644 --- a/pcbnew/tools/group_tool.cpp +++ b/pcbnew/tools/group_tool.cpp @@ -311,7 +311,6 @@ int GROUP_TOOL::Ungroup( const TOOL_EVENT& aEvent ) toSelect.push_back( member ); } - group->GetItems().clear(); group->SetSelected(); commit.Remove( group ); }