Filter Select All event against hierarchy
Fixes https://gitlab.com/kicad/code/kicad/issues/8316
This commit is contained in:
parent
a433451bd8
commit
78b555afa2
|
@ -969,6 +969,9 @@ int PCB_SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent )
|
||||||
// Filter the view items based on the selection box
|
// Filter the view items based on the selection box
|
||||||
BOX2I selectionBox;
|
BOX2I selectionBox;
|
||||||
|
|
||||||
|
// Intermediate step to allow filtering against hierarchy
|
||||||
|
GENERAL_COLLECTOR collection;
|
||||||
|
|
||||||
selectionBox.SetMaximum();
|
selectionBox.SetMaximum();
|
||||||
view->Query( selectionBox, selectedItems ); // Get the list of selected items
|
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 ) )
|
if( !item || !Selectable( item ) || !itemPassesFilter( item ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
select( item );
|
collection.Append( item );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FilterCollectorForHierarchy( collection );
|
||||||
|
|
||||||
|
for( EDA_ITEM* item : collection )
|
||||||
|
select( static_cast<BOARD_ITEM*>( item ) );
|
||||||
|
|
||||||
m_frame->GetCanvas()->ForceRefresh();
|
m_frame->GetCanvas()->ForceRefresh();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue