From 11d8b9ff552d259243ce2a35f335f499b2b962a0 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 14 Feb 2018 15:33:15 +0100 Subject: [PATCH] Fix double disambiguation menu when dragging --- pcbnew/router/router_tool.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index ac32044fd1..b42dc66136 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -1033,7 +1033,7 @@ void ROUTER_TOOL::NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECT } // Selection meets criteria; trim it to the reference item. - for( int i = aCollector.GetCount()-1; i >= 0; i-- ) + for( int i = aCollector.GetCount() - 1; i >= 0; i-- ) { if( dynamic_cast( aCollector[i] ) != reference ) aCollector.Remove( i ); @@ -1049,21 +1049,22 @@ bool ROUTER_TOOL::CanInlineDrag() if( selection.Size() == 1 ) { const BOARD_CONNECTED_ITEM* item = static_cast( selection.Front() ); + if( item->Type() == PCB_TRACE_T || item->Type() == PCB_VIA_T ) return true; } - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor ); // restore selection to unfiltered state return false; } int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) { - // Get the item under the cursor - m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, NeighboringSegmentFilter ); const auto& selection = m_toolMgr->GetTool()->GetSelection(); + if( selection.Empty() ) + m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, NeighboringSegmentFilter ); + if( selection.Size() != 1 ) return 0;