Make expand connection work on generated tracks

This commit is contained in:
Jon Evans 2024-02-08 19:28:17 -05:00
parent 69a69cc624
commit 037f349585
1 changed files with 11 additions and 3 deletions

View File

@ -1241,9 +1241,9 @@ int PCB_SELECTION_TOOL::expandConnection( const TOOL_EVENT& aEvent )
for( const EDA_ITEM* item : m_selection.GetItems() ) for( const EDA_ITEM* item : m_selection.GetItems() )
{ {
if( item->Type() == PCB_FOOTPRINT_T || if( item->Type() == PCB_FOOTPRINT_T
( BOARD_CONNECTED_ITEM::ClassOf( item ) || item->Type() == PCB_GENERATOR_T
&& static_cast<const BOARD_CONNECTED_ITEM*>( item )->IsConnected() ) ) || ( static_cast<const BOARD_ITEM*>( item )->IsConnected() ) )
{ {
initialCount++; initialCount++;
} }
@ -1287,6 +1287,14 @@ int PCB_SELECTION_TOOL::expandConnection( const TOOL_EVENT& aEvent )
for( PAD* pad : footprint->Pads() ) for( PAD* pad : footprint->Pads() )
startItems.push_back( pad ); startItems.push_back( pad );
} }
else if( item->Type() == PCB_GENERATOR_T )
{
for( BOARD_ITEM* generatedItem : static_cast<PCB_GENERATOR*>( item )->GetItems() )
{
if( BOARD_CONNECTED_ITEM::ClassOf( generatedItem ) )
startItems.push_back( static_cast<BOARD_CONNECTED_ITEM*>( generatedItem ) );
}
}
else if( BOARD_CONNECTED_ITEM::ClassOf( item ) ) else if( BOARD_CONNECTED_ITEM::ClassOf( item ) )
{ {
startItems.push_back( static_cast<BOARD_CONNECTED_ITEM*>( item ) ); startItems.push_back( static_cast<BOARD_CONNECTED_ITEM*>( item ) );