Filter Select All event against hierarchy

Fixes https://gitlab.com/kicad/code/kicad/issues/8316
This commit is contained in:
Seth Hillbrand 2021-04-27 16:58:26 -07:00
parent a433451bd8
commit 78b555afa2
1 changed files with 9 additions and 1 deletions

View File

@ -969,6 +969,9 @@ int PCB_SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent )
// Filter the view items based on the selection box
BOX2I selectionBox;
// Intermediate step to allow filtering against hierarchy
GENERAL_COLLECTOR collection;
selectionBox.SetMaximum();
view->Query( selectionBox, selectedItems ); // Get the list of selected items
@ -979,9 +982,14 @@ int PCB_SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent )
if( !item || !Selectable( item ) || !itemPassesFilter( item ) )
continue;
select( item );
collection.Append( item );
}
FilterCollectorForHierarchy( collection );
for( EDA_ITEM* item : collection )
select( static_cast<BOARD_ITEM*>( item ) );
m_frame->GetCanvas()->ForceRefresh();
return 0;