diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index f72d39a184..4e85367cef 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -2020,7 +2020,8 @@ void ROUTER_TOOL::performDragging( int aMode ) } -void ROUTER_TOOL::NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector ) +void ROUTER_TOOL::NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, + PCB_SELECTION_TOOL* aSelTool ) { /* * If the collection contains a trivial line corner (two connected segments) @@ -2077,7 +2078,8 @@ void ROUTER_TOOL::NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECT bool ROUTER_TOOL::CanInlineDrag( int aDragMode ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, NeighboringSegmentFilter ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, + NeighboringSegmentFilter ); const PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); if( selection.Size() == 1 ) @@ -2105,7 +2107,10 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) const PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); if( selection.Empty() ) - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, NeighboringSegmentFilter ); + { + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, + NeighboringSegmentFilter ); + } if( selection.Size() != 1 ) return 0; diff --git a/pcbnew/router/router_tool.h b/pcbnew/router/router_tool.h index e9cec79ce0..bfc01836ad 100644 --- a/pcbnew/router/router_tool.h +++ b/pcbnew/router/router_tool.h @@ -25,6 +25,8 @@ #include "pns_tool_base.h" +class PCB_SELECTION_TOOL; + class APIEXPORT ROUTER_TOOL : public PNS::TOOL_BASE { public: @@ -62,7 +64,8 @@ public: // A filter for narrowing a collection representing a simple corner // or a non-fanout-via to a single PCB_TRACK item. - static void NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector ); + static void NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, + PCB_SELECTION_TOOL* aSelTool ); void UpdateMessagePanel(); diff --git a/pcbnew/tools/board_inspection_tool.cpp b/pcbnew/tools/board_inspection_tool.cpp index 1971409012..1b3075a7d7 100644 --- a/pcbnew/tools/board_inspection_tool.cpp +++ b/pcbnew/tools/board_inspection_tool.cpp @@ -1757,13 +1757,15 @@ int BOARD_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, EDIT_TOOL::PadFilter ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, + EDIT_TOOL::PadFilter ); + PCB_SELECTION& selection = selectionTool->GetSelection(); if( selection.Empty() ) { - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, - EDIT_TOOL::FootprintFilter ); + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, + EDIT_TOOL::FootprintFilter ); selection = selectionTool->GetSelection(); }