A footprint does it's own child hit testing.

We only need to add it for groups.
This commit is contained in:
Jeff Young 2024-02-04 23:16:43 +00:00
parent 77c19fa99a
commit 0370db43ae
1 changed files with 9 additions and 6 deletions

View File

@ -2982,12 +2982,15 @@ bool PCB_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const
bool found = false;
static_cast<BOARD_ITEM*>( item )->RunOnDescendants(
[&]( BOARD_ITEM* aItem )
{
if( aItem->HitTest( aPoint, margin ) )
found = true;
} );
if( PCB_GROUP* group = dynamic_cast<PCB_GROUP*>( item ) )
{
group->RunOnDescendants(
[&]( BOARD_ITEM* aItem )
{
if( aItem->HitTest( aPoint, margin ) )
found = true;
} );
}
if( found )
return true;