PCB_GENERATOR_Ts are PCB_GROUP_Ts too.
Also, an item must already be in a commit to add it to a group. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17595
This commit is contained in:
parent
944835eefc
commit
9fb07d886e
|
@ -291,7 +291,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( boardItem->Type() == PCB_GROUP_T )
|
if( boardItem->Type() == PCB_GROUP_T || boardItem->Type() == PCB_GENERATOR_T )
|
||||||
addedGroup = static_cast<PCB_GROUP*>( boardItem );
|
addedGroup = static_cast<PCB_GROUP*>( boardItem );
|
||||||
|
|
||||||
if( m_isBoardEditor && autofillZones && boardItem->Type() != PCB_MARKER_T )
|
if( m_isBoardEditor && autofillZones && boardItem->Type() != PCB_MARKER_T )
|
||||||
|
@ -352,24 +352,6 @@ void BOARD_COMMIT::Push( const wxString& aMessage, int aCommitFlags )
|
||||||
case PCB_MARKER_T: // a marker used to show something
|
case PCB_MARKER_T: // a marker used to show something
|
||||||
case PCB_ZONE_T:
|
case PCB_ZONE_T:
|
||||||
case PCB_FOOTPRINT_T:
|
case PCB_FOOTPRINT_T:
|
||||||
if( view )
|
|
||||||
view->Remove( boardItem );
|
|
||||||
|
|
||||||
if( !( changeFlags & CHT_DONE ) )
|
|
||||||
{
|
|
||||||
if( parentFP )
|
|
||||||
{
|
|
||||||
parentFP->Remove( boardItem );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
board->Remove( boardItem, REMOVE_MODE::BULK );
|
|
||||||
bulkRemovedItems.push_back( boardItem );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PCB_GROUP_T:
|
case PCB_GROUP_T:
|
||||||
if( view )
|
if( view )
|
||||||
view->Remove( boardItem );
|
view->Remove( boardItem );
|
||||||
|
|
|
@ -1456,17 +1456,16 @@ void PCB_TUNING_PATTERN::EditPush( GENERATOR_TOOL* aTool, BOARD* aBoard, BOARD_C
|
||||||
|
|
||||||
for( BOARD_ITEM* item : routerAddedItems )
|
for( BOARD_ITEM* item : routerAddedItems )
|
||||||
{
|
{
|
||||||
|
aCommit->Add( item );
|
||||||
|
|
||||||
if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item ) )
|
if( PCB_TRACK* track = dynamic_cast<PCB_TRACK*>( item ) )
|
||||||
{
|
{
|
||||||
if( bounds.PointInside( track->GetStart(), epsilon )
|
if( bounds.PointInside( track->GetStart(), epsilon )
|
||||||
&& bounds.PointInside( track->GetEnd(), epsilon ) )
|
&& bounds.PointInside( track->GetEnd(), epsilon ) )
|
||||||
{
|
{
|
||||||
AddItem( item );
|
|
||||||
aCommit->Stage( item, CHT_GROUP );
|
aCommit->Stage( item, CHT_GROUP );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aCommit->Add( item );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue