eeschema: Pasted items are moving as soon as they are pasted

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9539
This commit is contained in:
Roberto Fernandez Bautista 2021-11-07 14:52:11 +00:00
parent e1cc7cfbe0
commit 04a30638f0
1 changed files with 3 additions and 3 deletions

View File

@ -1865,11 +1865,11 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
const_cast<KIID&>( item->m_Uuid ) = KIID();
}
item->SetFlags( IS_NEW | IS_PASTED );
item->SetFlags( IS_NEW | IS_PASTED | IS_MOVING );
m_frame->AddItemToScreenAndUndoList( m_frame->GetScreen(), (SCH_ITEM*) item, i > 0 );
// Reset flags for subsequent move operation
item->SetFlags( IS_NEW | IS_PASTED );
item->SetFlags( IS_NEW | IS_PASTED | IS_MOVING );
// Start out hidden so the pasted items aren't "ghosted" in their original location
// before being moved to the current location.
getView()->Hide( item, true );
@ -1930,7 +1930,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
SCH_ITEM* item = (SCH_ITEM*) selection.GetTopLeftItem();
selection.SetReferencePoint( item->GetPosition() );
m_toolMgr->RunAction( EE_ACTIONS::move, false );
}