From 7b5e3feb1996c6a2a112e913a3a6d9166db6603e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 4 Aug 2022 00:05:48 +0100 Subject: [PATCH] By-hand cherry-pick of 004abcd370713ae3350c665798c8a02ea2114955. --- pcbnew/tools/edit_tool.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 6dcd26fb1d..a7140e54b4 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -774,7 +774,9 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) if( boardItem ) { - orig_items.push_back( boardItem ); + if( !is_hover ) + orig_items.push_back( boardItem ); + sel_items.push_back( boardItem ); } @@ -1078,12 +1080,10 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) // Remove the dynamic ratsnest from the screen m_toolMgr->RunAction( PCB_ACTIONS::hideDynamicRatsnest, true ); - // Unselect all items to update flags + // Unselect all items to clear selection flags and then re-select the originally selected + // items. m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - - // Reselect items if they were already selected and we completed the move - if( !is_hover && !restore_state ) - m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &orig_items ); + m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &orig_items ); editFrame->PopTool( tool ); editFrame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );