Make Expand Connection respect the filter
Prevents expansion that would require traversing elements that are
disabled in the selection filter
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21581
(cherry picked from commit a811f61c39)
This commit is contained in:
@@ -1510,7 +1510,10 @@ void PCB_SELECTION_TOOL::selectAllConnectedTracks( const std::vector<BOARD_CONNE
|
||||
|
||||
// Select any starting track items
|
||||
if( startItem->IsType( { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T } ) )
|
||||
select( startItem );
|
||||
{
|
||||
if( itemPassesFilter( startItem, true ) )
|
||||
select( startItem );
|
||||
}
|
||||
}
|
||||
|
||||
for( BOARD_CONNECTED_ITEM* startItem : aStartItems )
|
||||
@@ -1624,6 +1627,18 @@ void PCB_SELECTION_TOOL::selectAllConnectedTracks( const std::vector<BOARD_CONNE
|
||||
bool gotNonStartPad =
|
||||
gotPad && ( startPadSet.find( padIt->second ) == startPadSet.end() );
|
||||
|
||||
if( gotPad && !itemPassesFilter( padIt->second, true ) )
|
||||
{
|
||||
activePts.erase( activePts.begin() + i );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( gotVia && !itemPassesFilter( viaIt->second, true ) )
|
||||
{
|
||||
activePts.erase( activePts.begin() + i );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( aStopCondition == STOP_AT_JUNCTION )
|
||||
{
|
||||
size_t pt_count = 0;
|
||||
@@ -1671,6 +1686,9 @@ void PCB_SELECTION_TOOL::selectAllConnectedTracks( const std::vector<BOARD_CONNE
|
||||
if( !layerSetCu.Contains( track->GetLayer() ) )
|
||||
continue;
|
||||
|
||||
if( !itemPassesFilter( track, true ) )
|
||||
continue;
|
||||
|
||||
if( !track->IsSelected() )
|
||||
select( track );
|
||||
|
||||
@@ -1693,6 +1711,9 @@ void PCB_SELECTION_TOOL::selectAllConnectedTracks( const std::vector<BOARD_CONNE
|
||||
if( !layerSetCu.Contains( shape->GetLayer() ) )
|
||||
continue;
|
||||
|
||||
if( !itemPassesFilter( shape, true ) )
|
||||
continue;
|
||||
|
||||
if( !shape->IsSelected() )
|
||||
select( shape );
|
||||
|
||||
@@ -1717,6 +1738,12 @@ void PCB_SELECTION_TOOL::selectAllConnectedTracks( const std::vector<BOARD_CONNE
|
||||
{
|
||||
PCB_VIA* via = viaMap[pt];
|
||||
|
||||
if( !itemPassesFilter( via, true ) )
|
||||
{
|
||||
activePts.erase( activePts.begin() + i );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( !via->IsSelected() )
|
||||
select( via );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user