From ab730709c7471001277db1b99f45f04bc044d84b Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 8 Mar 2018 18:02:55 +0000 Subject: [PATCH] Only use hover track if there are no selected tracks. Fixes: lp:1645670 * https://bugs.launchpad.net/kicad/+bug/1645670 --- pcbnew/tools/selection_tool.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index a02efdee7d..f30d0ed993 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -837,7 +837,10 @@ void connectedTrackFilter( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector ) int SELECTION_TOOL::selectConnection( const TOOL_EVENT& aEvent ) { - if( !selectCursor( true, connectedTrackFilter ) ) + if( !m_selection.HasType( PCB_TRACE_T ) && !m_selection.HasType( PCB_VIA_T ) ) + selectCursor( true, connectedTrackFilter ); + + if( !m_selection.HasType( PCB_TRACE_T ) && !m_selection.HasType( PCB_VIA_T ) ) return 0; return expandSelectedConnection( aEvent ); @@ -887,11 +890,19 @@ void connectedItemFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector ) int SELECTION_TOOL::selectCopper( const TOOL_EVENT& aEvent ) { - if( !selectCursor( true, connectedItemFilter ) ) - return 0; + bool haveCopper = false; + + for( auto item : m_selection.GetItems() ) + { + if( dynamic_cast( item ) ) + haveCopper = true;; + } + + if( !haveCopper ) + selectCursor( true, connectedItemFilter ); // copy the selection, since we're going to iterate and modify - auto selection = m_selection.GetItems(); + auto selection = m_selection.GetItems(); for( auto item : selection ) {