Browse Source

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

(cherry picked from commit 3f85071f91)
9.0
Jeff Young 2 months ago
parent
commit
f6fabdc8ee
  1. 5
      pcbnew/pcb_group.cpp
  2. 18
      pcbnew/tools/edit_tool.cpp

5
pcbnew/pcb_group.cpp

@ -137,12 +137,7 @@ PCB_GROUP* getNestedGroup( BOARD_ITEM* aItem, PCB_GROUP* aScope, bool isFootprin
return nullptr;
while( group && group->GetParentGroup() && group->GetParentGroup() != aScope )
{
if( group->GetParent()->Type() == PCB_FOOTPRINT_T && isFootprintEditor )
break;
group = group->GetParentGroup();
}
return group;
}

18
pcbnew/tools/edit_tool.cpp

@ -2243,25 +2243,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 )->RunOnDescendants(
[&]( BOARD_ITEM* descendant )
{
items.push_back( descendant );
} );
}
else
{
items.push_back( item );
}
}
for( EDA_ITEM* item : items )
{
if( !item->IsType( MirrorableItems ) )
continue;

Loading…
Cancel
Save