Rotate textbox shape along with text.

Fixes https://gitlab.com/kicad/code/kicad/issues/11187
This commit is contained in:
Jeff Young 2022-03-21 18:18:07 +00:00
parent 41c2a48802
commit 40e0c8257d
1 changed files with 8 additions and 1 deletions

View File

@ -36,7 +36,6 @@
#include <pcbnew.h>
#include <pcb_edit_frame.h>
#include <pcb_layer_box_selector.h>
#include <wx/valnum.h>
#include <math/util.h> // for KiROUND
#include <scintilla_tricks.h>
#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() );