mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
Don't double mirror groups.
Also removes previous fix, which had side-effects. Fixes https://gitlab.com/kicad/code/kicad/-/issues/8121 Fixes https://gitlab.com/kicad/code/kicad/-/issues/20465
This commit is contained in:
parent
73bb65b802
commit
3f85071f91
@ -133,12 +133,7 @@ EDA_GROUP* getNestedGroup( BOARD_ITEM* aItem, EDA_GROUP* aScope, bool isFootprin
|
||||
return nullptr;
|
||||
|
||||
while( group && group->AsEdaItem()->GetParentGroup() && group->AsEdaItem()->GetParentGroup() != aScope )
|
||||
{
|
||||
if( group->AsEdaItem()->GetParent()->Type() == PCB_FOOTPRINT_T && isFootprintEditor )
|
||||
break;
|
||||
|
||||
group = group->AsEdaItem()->GetParentGroup();
|
||||
}
|
||||
|
||||
return group;
|
||||
}
|
||||
|
@ -2321,26 +2321,7 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent )
|
||||
FLIP_DIRECTION flipDirection = aEvent.IsAction( &PCB_ACTIONS::mirrorV ) ? FLIP_DIRECTION::TOP_BOTTOM
|
||||
: FLIP_DIRECTION::LEFT_RIGHT;
|
||||
|
||||
std::vector<EDA_ITEM*> items;
|
||||
|
||||
for( EDA_ITEM* item : selection )
|
||||
{
|
||||
if( item->Type() == PCB_GROUP_T )
|
||||
{
|
||||
static_cast<PCB_GROUP*>( item )->RunOnChildren(
|
||||
[&]( BOARD_ITEM* descendant )
|
||||
{
|
||||
items.push_back( descendant );
|
||||
},
|
||||
RECURSE_MODE::RECURSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
items.push_back( item );
|
||||
}
|
||||
}
|
||||
|
||||
for( EDA_ITEM* item : items )
|
||||
{
|
||||
if( !item->IsType( MirrorableItems ) )
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user