Add items to repeat_items after paste (or duplicate).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15556
This commit is contained in:
Jeff Young 2023-09-02 11:56:26 +01:00
parent 41e274684c
commit f6e238dc3f
2 changed files with 5 additions and 2 deletions

View File

@ -154,8 +154,6 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
auto addSymbol =
[this]( SCH_SYMBOL* aSymbol )
{
m_frame->SaveCopyForRepeatItem( aSymbol );
m_toolMgr->RunAction( EE_ACTIONS::clearSelection );
m_selectionTool->AddItemToSel( aSymbol );
@ -356,6 +354,8 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
if( m_frame->eeconfig()->m_AutoplaceFields.enable )
symbol->AutoplaceFields( screen, false /* aManual */ );
m_frame->SaveCopyForRepeatItem( symbol );
SCH_COMMIT commit( m_toolMgr );
commit.Added( symbol, screen );

View File

@ -916,6 +916,9 @@ bool SCH_MOVE_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, SCH_COMMIT* aComm
sch_item->SetConnectivityDirty( true );
}
if( selection.GetSize() == 1 && selection.Front()->IsNew() )
m_frame->SaveCopyForRepeatItem( static_cast<SCH_ITEM*>( selection.Front() ) );
m_selectionTool->RemoveItemsFromSel( &m_dragAdditions, QUIET_MODE );
// If we move items away from a junction, we _may_ want to add a junction there