Don't leave a selection with a deleted item in it.
Fixes: lp:1803730 * https://bugs.launchpad.net/kicad/+bug/1803730
This commit is contained in:
parent
f71998b34e
commit
5bb5aea936
|
@ -246,12 +246,24 @@ int MODULE_EDITOR_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
|
||||||
break;
|
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();
|
commit.Revert();
|
||||||
break;
|
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 if( evt->IsClick( BUT_RIGHT ) )
|
else if( evt->IsClick( BUT_RIGHT ) )
|
||||||
{
|
{
|
||||||
m_menu.ShowContextMenu();
|
m_menu.ShowContextMenu();
|
||||||
|
|
Loading…
Reference in New Issue