By-hand cherry-pick of 004abcd370.

This commit is contained in:
Jeff Young 2022-08-04 00:05:48 +01:00
parent fec9331b48
commit 7b5e3feb19
1 changed files with 6 additions and 6 deletions

View File

@ -774,7 +774,9 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
if( boardItem ) if( boardItem )
{ {
if( !is_hover )
orig_items.push_back( boardItem ); orig_items.push_back( boardItem );
sel_items.push_back( boardItem ); sel_items.push_back( boardItem );
} }
@ -1078,11 +1080,9 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
// Remove the dynamic ratsnest from the screen // Remove the dynamic ratsnest from the screen
m_toolMgr->RunAction( PCB_ACTIONS::hideDynamicRatsnest, true ); 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 ); 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->PopTool( tool );