Speed-up EE_SELECTION_TOOL::RequestSelection.

This commit is contained in:
Alex 2022-07-03 20:23:08 +03:00 committed by Mike Williams
parent e2e574c84d
commit d343d87b73
1 changed files with 5 additions and 1 deletions

View File

@ -1136,6 +1136,7 @@ EE_SELECTION& EE_SELECTION_TOOL::RequestSelection( const KICAD_T aFilterList[] )
else // Trim an existing selection by aFilterList else // Trim an existing selection by aFilterList
{ {
bool isMoving = false; bool isMoving = false;
bool anyUnselected = false;
for( int i = (int) m_selection.GetSize() - 1; i >= 0; --i ) for( int i = (int) m_selection.GetSize() - 1; i >= 0; --i )
{ {
@ -1145,9 +1146,12 @@ EE_SELECTION& EE_SELECTION_TOOL::RequestSelection( const KICAD_T aFilterList[] )
if( !item->IsType( aFilterList ) ) if( !item->IsType( aFilterList ) )
{ {
unselect( item ); unselect( item );
anyUnselected = true;
}
}
if( anyUnselected )
m_toolMgr->ProcessEvent( EVENTS::UnselectedEvent ); m_toolMgr->ProcessEvent( EVENTS::UnselectedEvent );
}
}
if( !isMoving ) if( !isMoving )
updateReferencePoint(); updateReferencePoint();