Trim meander group items to just the tuning pattern.
This commit is contained in:
parent
2c9d43474d
commit
a2e35aabae
|
@ -1060,6 +1060,8 @@ void PCB_GENERATOR_MEANDERS::EditPush( GENERATOR_TOOL* aTool, BOARD* aBoard,
|
|||
const wxString& aCommitMsg, int aCommitFlags )
|
||||
{
|
||||
PNS::ROUTER* router = aTool->Router();
|
||||
SHAPE_LINE_CHAIN bounds = getRectShape();
|
||||
PICKED_ITEMS_LIST groupUndoList;
|
||||
|
||||
if( router->RoutingInProgress() )
|
||||
{
|
||||
|
@ -1083,9 +1085,17 @@ void PCB_GENERATOR_MEANDERS::EditPush( GENERATOR_TOOL* aTool, BOARD* aBoard,
|
|||
}
|
||||
|
||||
for( BOARD_ITEM* item : routerAddedItems )
|
||||
{
|
||||
PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item );
|
||||
|
||||
if( bounds.PointInside( track->GetPosition(), 2 )
|
||||
&& bounds.PointInside( track->GetEnd(), 2 ) )
|
||||
{
|
||||
item->SetSelected();
|
||||
AddItem( item );
|
||||
groupUndoList.PushItem( ITEM_PICKER( nullptr, item, UNDO_REDO::REGROUP ) );
|
||||
}
|
||||
|
||||
aCommit->Add( item );
|
||||
}
|
||||
}
|
||||
|
@ -1098,15 +1108,7 @@ void PCB_GENERATOR_MEANDERS::EditPush( GENERATOR_TOOL* aTool, BOARD* aBoard,
|
|||
else
|
||||
aCommit->Push( aCommitMsg, aCommitFlags );
|
||||
|
||||
if( isNew && !GetItems().empty() )
|
||||
{
|
||||
PICKED_ITEMS_LIST undoList;
|
||||
|
||||
for( BOARD_ITEM* member : GetItems() )
|
||||
undoList.PushItem( ITEM_PICKER( nullptr, member, UNDO_REDO::REGROUP ) );
|
||||
|
||||
aFrame->AppendCopyToUndoList( undoList, UNDO_REDO::REGROUP );
|
||||
}
|
||||
aFrame->AppendCopyToUndoList( groupUndoList, UNDO_REDO::REGROUP );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue