From 40e0c8257d937f79c002585d717aad2731889fc7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 21 Mar 2022 18:18:07 +0000 Subject: [PATCH] Rotate textbox shape along with text. Fixes https://gitlab.com/kicad/code/kicad/issues/11187 --- pcbnew/dialogs/dialog_textbox_properties.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pcbnew/dialogs/dialog_textbox_properties.cpp b/pcbnew/dialogs/dialog_textbox_properties.cpp index d2bddbea18..45bb58f657 100644 --- a/pcbnew/dialogs/dialog_textbox_properties.cpp +++ b/pcbnew/dialogs/dialog_textbox_properties.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include // for KiROUND #include #include "macros.h" @@ -358,7 +357,15 @@ bool DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow() m_edaText->SetTextThickness( maxPenWidth ); } + EDA_ANGLE delta = m_orientation.GetAngleValue() - m_edaText->GetTextAngle(); + + if( m_fpTextBox ) + m_fpTextBox->Rotate( m_fpTextBox->GetPosition(), delta ); + else if( m_pcbTextBox ) + m_pcbTextBox->Rotate( m_pcbTextBox->GetPosition(), delta ); + m_edaText->SetTextAngle( m_orientation.GetAngleValue() ); + m_edaText->SetBold( m_bold->IsChecked() ); m_edaText->SetItalic( m_italic->IsChecked() );