pcb: merge RunOnChildren/Descendants into one function with a mode

This commit is contained in:
Mike Williams
2025-03-27 13:16:09 -04:00
parent 7cf699bc9d
commit a90b8ec57a
34 changed files with 195 additions and 194 deletions
+6 -4
View File
@@ -306,11 +306,12 @@ void ARRAY_TOOL::onDialogClosed( wxCloseEvent& aEvent )
// it this state, reset the selected stated of aItem:
this_item->ClearSelected();
this_item->RunOnDescendants(
this_item->RunOnChildren(
[]( BOARD_ITEM* aItem )
{
aItem->ClearSelected();
} );
},
RECURSE_MODE::RECURSE );
// We're iterating backwards, so the first item is the last in the array
TransformItem( *m_array_opts, arraySize - ptN - 1, *this_item );
@@ -318,11 +319,12 @@ void ARRAY_TOOL::onDialogClosed( wxCloseEvent& aEvent )
// If a group is duplicated, add also created members to the board
if( this_item->Type() == PCB_GROUP_T )
{
this_item->RunOnDescendants(
this_item->RunOnChildren(
[&]( BOARD_ITEM* aItem )
{
commit.Add( aItem );
} );
},
RECURSE_MODE::RECURSE );
}
commit.Add( this_item );