From 250a2467619ece49c0c5a281a3a154b46581d100 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 16 Apr 2022 15:44:34 -0700 Subject: [PATCH] Clear flags after we're done with them The CANDIDATE flag is a temporary element that should not be maintained outside of the routine in which is it temporarily set Fixes https://gitlab.com/kicad/code/kicad/issues/11361 --- eeschema/tools/ee_selection_tool.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 21f5181c7c..d6d26be27e 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -1240,6 +1240,7 @@ bool EE_SELECTION_TOOL::selectMultiple() // Build lists of nearby items and their children std::vector nearbyItems; std::vector nearbyChildren; + std::vector flaggedItems; for( KIGFX::VIEW::LAYER_ITEM_PAIR& pair : nearbyViewItems ) { @@ -1313,6 +1314,7 @@ bool EE_SELECTION_TOOL::selectMultiple() if( Selectable( item ) && item->HitTest( selectionRect, isWindowSelection ) ) { item->SetFlags( CANDIDATE ); + flaggedItems.push_back( item ); selectItem( item ); } } @@ -1327,6 +1329,9 @@ bool EE_SELECTION_TOOL::selectMultiple() } } + for( EDA_ITEM* item : flaggedItems ) + item->ClearFlags( CANDIDATE ); + m_selection.SetIsHover( false ); // Inform other potentially interested tools