From 10b635ffe2996ec102a93118a0b34bf5ebf9466f Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 17 Jan 2018 21:51:48 -0500 Subject: [PATCH] Clear autoplaced flag when modifiying field orientation/justification Fixes: lp:1743893 * https://bugs.launchpad.net/kicad/+bug/1743893 --- eeschema/dialogs/dialog_edit_one_field.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/eeschema/dialogs/dialog_edit_one_field.cpp b/eeschema/dialogs/dialog_edit_one_field.cpp index 6fd58bf287..3aeea4d36c 100644 --- a/eeschema/dialogs/dialog_edit_one_field.cpp +++ b/eeschema/dialogs/dialog_edit_one_field.cpp @@ -301,6 +301,25 @@ void DIALOG_SCH_EDIT_ONE_FIELD::UpdateField( SCH_FIELD* aField, SCH_SHEET_PATH* component->SetRef( aSheetPath, m_text ); } + bool modified = false; + + modified = ( modified || + ( ( aField->GetTextAngle() == TEXT_ANGLE_VERT ) != m_orientation ) ); + + modified = ( modified || + ( ( aField->GetHorizJustify() != + IntToEdaTextHorizJustify( m_horizontalJustification - 1 ) ) ) ); + + modified = ( modified || + ( ( aField->GetVertJustify() != + IntToEdaTextVertJustify( m_verticalJustification - 1 ) ) ) ); + aField->SetText( m_text ); updateText( aField ); + + if( modified ) + { + auto component = static_cast< SCH_COMPONENT* >( aField->GetParent() ); + component->ClearFieldsAutoplaced(); + } }