From e9847cf2bd3578628114e8e59c221e5b205e617c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 8 Dec 2021 23:15:24 +0000 Subject: [PATCH] Exclude vias from first 'U' step. Fixes https://gitlab.com/kicad/code/kicad/issues/9902 --- pcbnew/tools/pcb_selection_tool.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 93c7bd98b2..049c02edd1 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -1229,7 +1229,7 @@ void PCB_SELECTION_TOOL::selectConnectedTracks( BOARD_CONNECTED_ITEM& aStartItem { wxPoint pt = activePts[i].first; PCB_LAYER_ID layer = activePts[i].second; - size_t pt_count = padMap.count( pt ) * 2 + viaMap.count( pt ); + size_t pt_count = 0; for( PCB_TRACK* track : trackMap[pt] ) { @@ -1237,15 +1237,23 @@ void PCB_SELECTION_TOOL::selectConnectedTracks( BOARD_CONNECTED_ITEM& aStartItem pt_count++; } - if( pt_count > 2 && aStopCondition == STOP_AT_JUNCTION ) + if( aStopCondition == STOP_AT_JUNCTION ) { - activePts.erase( activePts.begin() + i ); - continue; + if( pt_count > 2 + || ( viaMap.count( pt ) && layer != ALL_LAYERS ) + || ( padMap.count( pt ) && layer != ALL_LAYERS ) ) + { + activePts.erase( activePts.begin() + i ); + continue; + } } - else if( padMap.count( pt ) && aStopCondition == STOP_AT_PAD ) + else if( aStopCondition == STOP_AT_PAD ) { - activePts.erase( activePts.begin() + i ); - continue; + if( padMap.count( pt ) ) + { + activePts.erase( activePts.begin() + i ); + continue; + } } if( padMap.count( pt ) )