Make expand selection stop at vias

During the first expansion, we are supposed to stop at vias and branches
(where three track ends connect).  This needs to account for the number
of vias and tracks not just tracks
This commit is contained in:
Seth Hillbrand 2021-01-01 09:30:36 -08:00
parent fc1b0ec11f
commit 72c27b2e33
1 changed files with 3 additions and 2 deletions

View File

@ -1143,8 +1143,9 @@ void PCB_SELECTION_TOOL::selectConnectedTracks( BOARD_CONNECTED_ITEM& aStartItem
for( int i = activePts.size() - 1; i >= 0; --i )
{
wxPoint pt = activePts[i];
size_t pt_count = trackMap[ pt ].size() + viaMap.count( pt );
if( trackMap[ pt ].size() > 2 && aStopCondition == STOP_AT_JUNCTION )
if( pt_count > 2 && aStopCondition == STOP_AT_JUNCTION )
{
activePts.erase( activePts.begin() + i );
continue;
@ -1172,7 +1173,7 @@ void PCB_SELECTION_TOOL::selectConnectedTracks( BOARD_CONNECTED_ITEM& aStartItem
expand = true;
}
if( viaMap.count( pt ) && !viaMap[ pt ]->IsSelected() )
if( viaMap.count( pt ) && !viaMap[ pt ]->IsSelected() && aStopCondition != STOP_AT_JUNCTION )
select( viaMap[ pt ] );
activePts.erase( activePts.begin() + i );