From 4b226b8172aafdc1aa3f83b7c18241620d96455f Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 27 Nov 2021 06:34:23 -0800 Subject: [PATCH] Unify our breakTracks routines Fixes https://gitlab.com/kicad/code/kicad/issues/9793 --- pcbnew/router/router_tool.cpp | 3 ++- pcbnew/tools/edit_tool.cpp | 2 +- pcbnew/tools/pcb_actions.cpp | 6 ------ pcbnew/tools/pcb_actions.h | 3 --- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 02a0039f8f..61b0149f4c 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -1428,6 +1428,7 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent ) { updateStartItem( *evt, true ); breakTrack( ); + evt->SetPassEvent( false ); } else if( evt->IsClick( BUT_LEFT ) || evt->IsAction( &PCB_ACTIONS::routeSingleTrack ) @@ -2109,7 +2110,7 @@ void ROUTER_TOOL::setTransitions() Go( &ROUTER_TOOL::ChangeRouterMode, PCB_ACTIONS::routerWalkaroundMode.MakeEvent() ); Go( &ROUTER_TOOL::CycleRouterMode, PCB_ACTIONS::cycleRouterMode.MakeEvent() ); Go( &ROUTER_TOOL::InlineDrag, PCB_ACTIONS::routerInlineDrag.MakeEvent() ); - Go( &ROUTER_TOOL::InlineBreakTrack, PCB_ACTIONS::inlineBreakTrack.MakeEvent() ); + Go( &ROUTER_TOOL::InlineBreakTrack, PCB_ACTIONS::breakTrack.MakeEvent() ); Go( &ROUTER_TOOL::onViaCommand, ACT_PlaceThroughVia.MakeEvent() ); Go( &ROUTER_TOOL::onViaCommand, ACT_PlaceBlindVia.MakeEvent() ); diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 71b77b2a9d..34d0bf17c4 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -164,7 +164,7 @@ bool EDIT_TOOL::Init() menu.AddItem( PCB_ACTIONS::move, SELECTION_CONDITIONS::NotEmpty && notMovingCondition ); - menu.AddItem( PCB_ACTIONS::inlineBreakTrack, SELECTION_CONDITIONS::Count( 1 ) + menu.AddItem( PCB_ACTIONS::breakTrack, SELECTION_CONDITIONS::Count( 1 ) && SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::Tracks ) ); menu.AddItem( PCB_ACTIONS::drag45Degree, SELECTION_CONDITIONS::Count( 1 ) && SELECTION_CONDITIONS::OnlyTypes( GENERAL_COLLECTOR::DraggableItems ) ); diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 672bf0b681..b3dbdea882 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -1381,12 +1381,6 @@ TOOL_ACTION PCB_ACTIONS::routerUndoLastSegment( "pcbnew.InteractiveRouter.UndoLa WXK_BACK, "", _( "Undo Last Segment" ), _( "Walks the current track back one segment." ) ); -TOOL_ACTION PCB_ACTIONS::inlineBreakTrack( "pcbnew.InteractiveRouter.InlineBreakTrack", - AS_GLOBAL, 0, "", - _( "Break Track" ), - _( "Splits the track segment into two segments connected at the cursor position." ), - BITMAPS::break_line ); - TOOL_ACTION PCB_ACTIONS::breakTrack( "pcbnew.InteractiveRouter.BreakTrack", AS_GLOBAL, 0, "", _( "Break Track" ), diff --git a/pcbnew/tools/pcb_actions.h b/pcbnew/tools/pcb_actions.h index c2744644d8..e77bb80c1e 100644 --- a/pcbnew/tools/pcb_actions.h +++ b/pcbnew/tools/pcb_actions.h @@ -131,9 +131,6 @@ public: /// Break a single track into two segments at the cursor static TOOL_ACTION breakTrack; - /// Breaks track when router is not activated - static TOOL_ACTION inlineBreakTrack; - static TOOL_ACTION drag45Degree; static TOOL_ACTION dragFreeAngle;