Add duplicated items to parent group.
Fixes https://gitlab.com/kicad/code/kicad/issues/10155
(cherry picked from commit 42917874dd
)
This commit is contained in:
parent
430c4862b6
commit
2365c1e96f
|
@ -168,13 +168,7 @@ public:
|
|||
/**
|
||||
* Create a copy of this #BOARD_ITEM.
|
||||
*/
|
||||
virtual BOARD_ITEM* Duplicate() const
|
||||
{
|
||||
EDA_ITEM* dupe = Clone();
|
||||
const_cast<KIID&>( dupe->m_Uuid ) = KIID();
|
||||
|
||||
return static_cast<BOARD_ITEM*>( dupe );
|
||||
}
|
||||
virtual BOARD_ITEM* Duplicate() const;
|
||||
|
||||
/**
|
||||
* Swap data between \a aItem and \a aImage.
|
||||
|
|
|
@ -141,6 +141,18 @@ void BOARD_ITEM::SwapData( BOARD_ITEM* aImage )
|
|||
}
|
||||
|
||||
|
||||
BOARD_ITEM* BOARD_ITEM::Duplicate() const
|
||||
{
|
||||
BOARD_ITEM* dupe = static_cast<BOARD_ITEM*>( Clone() );
|
||||
const_cast<KIID&>( dupe->m_Uuid ) = KIID();
|
||||
|
||||
if( dupe->GetParentGroup() )
|
||||
dupe->GetParentGroup()->AddItem( dupe );
|
||||
|
||||
return static_cast<BOARD_ITEM*>( dupe );
|
||||
}
|
||||
|
||||
|
||||
void BOARD_ITEM::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
PCB_LAYER_ID aLayer, int aClearanceValue,
|
||||
int aError, ERROR_LOC aErrorLoc,
|
||||
|
|
|
@ -1723,15 +1723,14 @@ void FOOTPRINT::SetOrientation( double aNewAngle )
|
|||
|
||||
BOARD_ITEM* FOOTPRINT::Duplicate() const
|
||||
{
|
||||
FOOTPRINT* dupe = (FOOTPRINT*) Clone();
|
||||
const_cast<KIID&>( dupe->m_Uuid ) = KIID();
|
||||
FOOTPRINT* dupe = static_cast<FOOTPRINT*>( BOARD_ITEM::Duplicate() );
|
||||
|
||||
dupe->RunOnChildren( [&]( BOARD_ITEM* child )
|
||||
{
|
||||
const_cast<KIID&>( child->m_Uuid ) = KIID();
|
||||
});
|
||||
|
||||
return static_cast<BOARD_ITEM*>( dupe );
|
||||
return dupe;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue