eeschema: Prevent double-commit on duplicate/copy

When activating the move from a drag extension, we need to add
additional components to the commit.  This breaks for duplicate/copy
when we have already added the correct components
This commit is contained in:
Seth Hillbrand 2019-05-09 07:46:35 -07:00
parent 5f4a6e33a0
commit 2f782ac7a4
1 changed files with 3 additions and 1 deletions

View File

@ -257,7 +257,9 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
{
if( item->IsNew() )
{
if( ( item->GetFlags() & SELECTEDNODE ) != 0 )
// TODO(snh): Remove extra tooling check after moving to schematic_commit model
if( ( item->GetFlags() & SELECTEDNODE ) != 0
&& ( m_frame->GetToolId() == ID_SCH_DRAG ) )
{
// Item was added in getConnectedDragItems
saveCopyInUndoList( (SCH_ITEM*) item, UR_NEW, appendUndo );