7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 14:31:42 +00:00

Make sure custom shape primitives get parents updated

This commit is contained in:
Jon Evans 2024-11-19 19:57:05 -05:00
parent 4ab89c1a07
commit eaa4367694

View File

@ -58,6 +58,13 @@ PADSTACK::PADSTACK( const PADSTACK& aOther )
{
m_parent = aOther.m_parent;
*this = aOther;
ForEachUniqueLayer(
[&]( PCB_LAYER_ID aLayer )
{
for( std::shared_ptr<PCB_SHAPE>& shape : CopperLayer( aLayer ).custom_shapes )
shape->SetParent( m_parent );
} );
}
@ -1280,6 +1287,7 @@ const std::vector<std::shared_ptr<PCB_SHAPE>>& PADSTACK::Primitives( PCB_LAYER_I
void PADSTACK::AddPrimitive( PCB_SHAPE* aShape, PCB_LAYER_ID aLayer )
{
aShape->SetParent( m_parent );
CopperLayer( aLayer ).custom_shapes.emplace_back( aShape );
}