diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index ab8ff540de..40d39a3fe6 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -1544,15 +1544,18 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) BOARD_ITEM* item = dynamic_cast( 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