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