pcbnew: Ensure we are cloning pads

When calling MODULE::Clone() we need to clone the pads as well or we
will end up with scm churn when running undo/redo operations
This commit is contained in:
Seth Hillbrand 2020-08-24 16:01:55 -07:00
parent 24435fcc62
commit 35eda030a2
2 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,7 @@ MODULE::MODULE( const MODULE& aModule ) :
// Copy auxiliary data: Pads
for( D_PAD* pad : aModule.Pads() )
Add( new D_PAD( *pad ) );
Add( static_cast<D_PAD*>( pad->Clone() ) );
// Copy auxiliary data: Zones
for( MODULE_ZONE_CONTAINER* item : aModule.Zones() )

View File

@ -115,6 +115,7 @@ D_PAD::D_PAD( const D_PAD& aOther ) :
m_effectiveBoundingRadius = aOther.m_effectiveBoundingRadius;
m_removeUnconnectedLayer = aOther.m_removeUnconnectedLayer;
m_keepTopBottomLayer = aOther.m_keepTopBottomLayer;
const_cast<KIID&>( m_Uuid ) = aOther.m_Uuid;
}