7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

DRAWING_TOOL::PlaceImportedGraphics() do not add twice items when adding to new group.

This commit is contained in:
jean-pierre charras 2023-11-16 12:53:00 +01:00
parent 83ee2ffdab
commit ed9dd55fde

View File

@ -1544,15 +1544,18 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( ptr.release() );
wxCHECK2( item, continue );
newItems.push_back( item );
if( group )
group->AddItem( item );
else
{
newItems.push_back( item );
selectedItems.push_back( item );
}
groupUndoList.PushItem( ITEM_PICKER( nullptr, item, UNDO_REDO::REGROUP ) );
layer = item->GetLayer();
preview.Add( item );
}
@ -1569,8 +1572,6 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
return 0;
}
layer = newItems.front()->GetLayer();
m_view->Add( &preview );
// Clear the current selection then select the drawings so that edit tools work on them