PCB Editor: Allow mouse drag of group-of-groups

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13076
This commit is contained in:
Mike Williams 2022-12-28 15:23:52 -05:00
parent e65de51fc7
commit 411efe6f3d
1 changed files with 16 additions and 7 deletions

View File

@ -2715,15 +2715,24 @@ bool PCB_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const
if( item->HitTest( aPoint, margin ) )
return true;
bool found = false;
std::function<void( PCB_GROUP* )> checkGroup;
checkGroup = [&]( PCB_GROUP* aGroup )
{
aGroup->RunOnChildren(
[&]( BOARD_ITEM* aItem )
{
if( PCB_GROUP* group = dyn_cast<PCB_GROUP*>( aItem ) )
checkGroup( group );
else if( aItem->HitTest( aPoint, margin ) )
found = true;
} );
};
if( PCB_GROUP* group = dyn_cast<PCB_GROUP*>( item ) )
{
bool found = false;
group->RunOnChildren( [&] ( BOARD_ITEM* aItem )
{
if( aItem->HitTest( aPoint, margin ) )
found = true;
} );
checkGroup( group );
if( found )
return true;