7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 11:01:41 +00:00

Make sure sheet field parents are up to date

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7251
This commit is contained in:
Jon Evans 2021-01-24 12:12:13 -05:00
parent f353fc448b
commit 09bd66477d

View File

@ -273,6 +273,12 @@ void SCH_SHEET::SwapData( SCH_ITEM* aItem )
for( SCH_SHEET_PIN* sheetPin : sheet->m_pins )
sheetPin->SetParent( sheet );
for( SCH_FIELD& field : m_fields )
field.SetParent( this );
for( SCH_FIELD& field : sheet->m_fields )
field.SetParent( sheet );
std::swap( m_borderWidth, sheet->m_borderWidth );
std::swap( m_borderColor, sheet->m_borderColor );
std::swap( m_backgroundColor, sheet->m_backgroundColor );