From d343d87b7306a092cb65531b4f0a8c14bb5a23f5 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 3 Jul 2022 20:23:08 +0300 Subject: [PATCH] Speed-up EE_SELECTION_TOOL::RequestSelection. --- eeschema/tools/ee_selection_tool.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 63193434b9..3526a8e6a0 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -1136,6 +1136,7 @@ EE_SELECTION& EE_SELECTION_TOOL::RequestSelection( const KICAD_T aFilterList[] ) else // Trim an existing selection by aFilterList { bool isMoving = false; + bool anyUnselected = false; for( int i = (int) m_selection.GetSize() - 1; i >= 0; --i ) { @@ -1145,10 +1146,13 @@ EE_SELECTION& EE_SELECTION_TOOL::RequestSelection( const KICAD_T aFilterList[] ) if( !item->IsType( aFilterList ) ) { unselect( item ); - m_toolMgr->ProcessEvent( EVENTS::UnselectedEvent ); + anyUnselected = true; } } + if( anyUnselected ) + m_toolMgr->ProcessEvent( EVENTS::UnselectedEvent ); + if( !isMoving ) updateReferencePoint(); }