Don't leave a selection with a deleted item in it.
Fixes: lp:1803730
* https://bugs.launchpad.net/kicad/+bug/1803730
(cherry picked from commit 5bb5aea936
)
This commit is contained in:
parent
22fbf30f22
commit
66b0aca696
|
@ -239,12 +239,24 @@ int MODULE_EDITOR_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
|
|||
break;
|
||||
}
|
||||
|
||||
else if( evt->IsCancel() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsActivate() )
|
||||
// This is a cancel-current-action (ie: <esc>).
|
||||
// Note that this must go before IsCancelInteractive() as it also checks IsCancel().
|
||||
else if( evt->IsCancel() )
|
||||
{
|
||||
// Clear current selection list to avoid selection of deleted items
|
||||
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||
|
||||
commit.Revert();
|
||||
break;
|
||||
}
|
||||
|
||||
// Now that cancel-current-action has been handled, check for cancel-tool.
|
||||
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||
{
|
||||
commit.Push( _( "Renumber pads" ) );
|
||||
break;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
// Delegate BUT_RIGHT, etc. to SELECTION_TOOL
|
||||
|
|
Loading…
Reference in New Issue