Copy field properly.
Offset for new parent, and set parent property. Fixes https://gitlab.com/kicad/code/kicad/issues/12376
This commit is contained in:
parent
fb48bef49f
commit
45fb0107a0
|
@ -751,8 +751,14 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
|||
}
|
||||
else
|
||||
{
|
||||
SCH_FIELD* newField = otherUnit->AddField( m_fields->at( ii ) );
|
||||
const_cast<KIID&>( newField->m_Uuid ) = KIID();
|
||||
SCH_FIELD newField( m_fields->at( ii ) );
|
||||
const_cast<KIID&>( newField.m_Uuid ) = KIID();
|
||||
|
||||
newField.Offset( -m_symbol->GetPosition() );
|
||||
newField.Offset( otherUnit->GetPosition() );
|
||||
|
||||
newField.SetParent( otherUnit );
|
||||
otherUnit->AddField( newField );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue