Performance update for pcbnew net inspector

Forces full rebuild of nets list for bulk updates over a certain
size. This is more performant than iterating over all items in
a bulk update.
This commit is contained in:
JamesJ 2024-03-24 20:29:15 +00:00
parent f51e775f26
commit 54919e6854
1 changed files with 21 additions and 4 deletions

View File

@ -963,9 +963,18 @@ void PCB_NET_INSPECTOR_PANEL::OnBoardItemsAdded( BOARD& aBoar
if( !IsShownOnScreen() )
return;
for( BOARD_ITEM* item : aBoardItems )
// Rebuild full netlist for large changes
if( aBoardItems.size() > 25 )
{
OnBoardItemAdded( aBoard, item );
buildNetsList();
m_netsList->Refresh();
}
else
{
for( BOARD_ITEM* item : aBoardItems )
{
OnBoardItemAdded( aBoard, item );
}
}
}
@ -1037,9 +1046,17 @@ void PCB_NET_INSPECTOR_PANEL::OnBoardItemsRemoved( BOARD& aBo
if( !IsShownOnScreen() )
return;
for( BOARD_ITEM* item : aBoardItems )
if( aBoardItems.size() > 25 )
{
OnBoardItemRemoved( aBoard, item );
buildNetsList();
m_netsList->Refresh();
}
else
{
for( BOARD_ITEM* item : aBoardItems )
{
OnBoardItemRemoved( aBoard, item );
}
}
}