Don't re-enter router on subsequent X key.

Fixes https://gitlab.com/kicad/code/kicad/issues/6656

Fixes https://gitlab.com/kicad/code/kicad/issues/4504
This commit is contained in:
Jeff Young 2020-12-07 23:58:51 +00:00
parent ac32d6a4b6
commit aa3e29ee7c
1 changed files with 8 additions and 6 deletions

View File

@ -1158,6 +1158,14 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
PNS::ROUTER_MODE mode = aEvent.Parameter<PNS::ROUTER_MODE>(); PNS::ROUTER_MODE mode = aEvent.Parameter<PNS::ROUTER_MODE>();
PCB_EDIT_FRAME* frame = getEditFrame<PCB_EDIT_FRAME>(); PCB_EDIT_FRAME* frame = getEditFrame<PCB_EDIT_FRAME>();
if( m_router->RoutingInProgress() )
{
if( m_router->Mode() == mode )
return 0;
else
m_router->StopRouting();
}
// Deselect all items // Deselect all items
m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true );
@ -1239,12 +1247,6 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
|| evt->IsAction( &PCB_ACTIONS::routeSingleTrack ) || evt->IsAction( &PCB_ACTIONS::routeSingleTrack )
|| evt->IsAction( &PCB_ACTIONS::routeDiffPair ) ) || evt->IsAction( &PCB_ACTIONS::routeDiffPair ) )
{ {
if( evt->IsAction( &PCB_ACTIONS::routeSingleTrack )
|| evt->IsAction( &PCB_ACTIONS::routeDiffPair ) )
{
mode = evt->Parameter<PNS::ROUTER_MODE>();
}
updateStartItem( *evt ); updateStartItem( *evt );
if( evt->HasPosition() ) if( evt->HasPosition() )