Skip to content
Snippets Groups Projects
Commit a677998f authored by Jonathan Haas's avatar Jonathan Haas
Browse files

Don't select new items after cancelling move following item duplication

Fixes #7956
parent 9f8127af
No related branches found
No related tags found
No related merge requests found
Pipeline #274548041 passed
......@@ -932,7 +932,8 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
editFrame->PopTool( tool );
return 0;
return restore_state ? -1 : 0;
}
......@@ -2086,13 +2087,16 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
// If items were duplicated, pick them up
// this works well for "dropping" copies around and pushes the commit
TOOL_EVENT evt = PCB_ACTIONS::move.MakeEvent();
Move( evt );
bool move_cancelled = Move( evt ) == -1;
// After moving the new items, we need to refresh the group and view flags
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
if( !is_hover )
if( !is_hover && !move_cancelled )
{
// Do not select new items if they've been deleted again by cancelling Move()
m_toolMgr->RunAction( PCB_ACTIONS::selectItems, true, &new_items );
}
}
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment