DRAWING_TOOL::PlaceImportedGraphics() do not add twice items when adding to new group.
This commit is contained in:
parent
83ee2ffdab
commit
ed9dd55fde
|
@ -1544,15 +1544,18 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
|
||||||
BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( ptr.release() );
|
BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( ptr.release() );
|
||||||
wxCHECK2( item, continue );
|
wxCHECK2( item, continue );
|
||||||
|
|
||||||
newItems.push_back( item );
|
|
||||||
|
|
||||||
if( group )
|
if( group )
|
||||||
group->AddItem( item );
|
group->AddItem( item );
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
newItems.push_back( item );
|
||||||
selectedItems.push_back( item );
|
selectedItems.push_back( item );
|
||||||
|
}
|
||||||
|
|
||||||
groupUndoList.PushItem( ITEM_PICKER( nullptr, item, UNDO_REDO::REGROUP ) );
|
groupUndoList.PushItem( ITEM_PICKER( nullptr, item, UNDO_REDO::REGROUP ) );
|
||||||
|
|
||||||
|
layer = item->GetLayer();
|
||||||
|
|
||||||
preview.Add( item );
|
preview.Add( item );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1569,8 +1572,6 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
layer = newItems.front()->GetLayer();
|
|
||||||
|
|
||||||
m_view->Add( &preview );
|
m_view->Add( &preview );
|
||||||
|
|
||||||
// Clear the current selection then select the drawings so that edit tools work on them
|
// Clear the current selection then select the drawings so that edit tools work on them
|
||||||
|
|
Loading…
Reference in New Issue