Re-parent new objects on duplicate.
Fixes: lp:1838269 * https://bugs.launchpad.net/kicad/+bug/1838269
This commit is contained in:
parent
2b32070793
commit
c624ee9cff
|
@ -712,15 +712,13 @@ int LIB_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
|
|||
if( !selection.Front()->IsMoving() )
|
||||
saveCopyInUndoList( m_frame->GetCurPart(), UR_LIBEDIT );
|
||||
|
||||
EDA_ITEMS newItems;
|
||||
|
||||
for( unsigned ii = 0; ii < selection.GetSize(); ++ii )
|
||||
{
|
||||
LIB_ITEM* oldItem = static_cast<LIB_ITEM*>( selection.GetItem( ii ) );
|
||||
LIB_ITEM* newItem = (LIB_ITEM*) oldItem->Clone();
|
||||
oldItem->ClearFlags( SELECTED );
|
||||
newItem->SetFlags( IS_NEW | IS_PASTED | SELECTED );
|
||||
newItems.push_back( newItem );
|
||||
newItem->SetParent( part );
|
||||
|
||||
part->GetDrawItems().push_back( newItem );
|
||||
getView()->Add( newItem );
|
||||
|
|
Loading…
Reference in New Issue