From aa3e29ee7ce16295152676c24d07189b63b6c0c5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 7 Dec 2020 23:58:51 +0000 Subject: [PATCH] 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 --- pcbnew/router/router_tool.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index de01b507d5..69b6f1b371 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -1158,6 +1158,14 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent ) PNS::ROUTER_MODE mode = aEvent.Parameter(); PCB_EDIT_FRAME* frame = getEditFrame(); + if( m_router->RoutingInProgress() ) + { + if( m_router->Mode() == mode ) + return 0; + else + m_router->StopRouting(); + } + // Deselect all items 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::routeDiffPair ) ) { - if( evt->IsAction( &PCB_ACTIONS::routeSingleTrack ) - || evt->IsAction( &PCB_ACTIONS::routeDiffPair ) ) - { - mode = evt->Parameter(); - } - updateStartItem( *evt ); if( evt->HasPosition() )