From c16dda40278d968a7533640f88802f4e8a16141c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 27 Dec 2020 13:16:16 +0000 Subject: [PATCH] Make sure added wires (from junctions) don't get left selected. Fixes https://gitlab.com/kicad/code/kicad/issues/6852 --- eeschema/tools/sch_move_tool.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index 63c83eefb1..c265fc265e 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -478,6 +478,9 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) for( EDA_ITEM* item : selection ) updateItem( item, true ); + EE_SELECTION selectionCopy( selection ); + m_selectionTool->RemoveItemsFromSel( &m_dragAdditions, QUIET_MODE ); + // If we move items away from a junction, we _may_ want to add a junction there // to denote the state. for( const DANGLING_END_ITEM& it : internalPoints ) @@ -486,8 +489,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) m_frame->AddJunction( m_frame->GetScreen(), it.GetPosition(), true, false ); } - m_toolMgr->RunAction( EE_ACTIONS::addNeededJunctions, true, &selection ); - m_selectionTool->RemoveItemsFromSel( &m_dragAdditions, QUIET_MODE ); + m_toolMgr->RunAction( EE_ACTIONS::addNeededJunctions, true, &selectionCopy ); m_frame->SchematicCleanUp(); m_frame->TestDanglingEnds();