Exit a group when selecting a component outside it

We had this filter in place when doing mouse selection, but not when
the selection comes from another tool event.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13398
This commit is contained in:
Jon Evans 2023-01-05 20:32:35 -05:00
parent b6b5a8ef6e
commit 1ccd387c8d
2 changed files with 10 additions and 0 deletions

View File

@ -2613,6 +2613,13 @@ void PCB_SELECTION_TOOL::select( EDA_ITEM* aItem )
return;
}
if( m_enteredGroup &&
!PCB_GROUP::WithinScope( static_cast<BOARD_ITEM*>( aItem ), m_enteredGroup,
m_isFootprintEditor ) )
{
ExitGroup();
}
highlight( aItem, SELECTED, &m_selection );
}

View File

@ -144,6 +144,9 @@ void PCB_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent )
PCB_SELECTION_TOOL* selectionTool = m_frame->GetToolManager()->GetTool<PCB_SELECTION_TOOL>();
const SELECTION& selection = selectionTool->GetSelection();
BOARD_ITEM* firstItem = static_cast<BOARD_ITEM*>( selection.Front() );
wxCHECK( firstItem, /* void */ );
PROPERTY_BASE* property = m_propMgr.GetProperty( TYPE_HASH( *firstItem ),
aEvent.GetPropertyName() );
wxVariant newValue = aEvent.GetPropertyValue();