PCB_DIM_ALIGNED and DIALOG_DIMENSION_PROPERTIES: fix bad text rotation.

Fixes #10901
https://gitlab.com/kicad/code/kicad/issues/10901
This commit is contained in:
jean-pierre charras 2022-02-19 10:24:44 +01:00
parent 2560c8f31b
commit b184b43431
2 changed files with 3 additions and 3 deletions

View File

@ -246,6 +246,7 @@ bool DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow()
}
m_orientation.SetAngleValue( text.GetTextAngle() );
m_cbKeepAligned->SetValue( m_dimension->GetKeepTextAligned() );
m_bold->Check( text.IsBold() );
m_italic->Check( text.IsItalic() );

View File

@ -656,7 +656,6 @@ void PCB_DIM_ALIGNED::updateText()
if( m_textPosition == DIM_TEXT_POSITION::OUTSIDE )
{
int textOffsetDistance = m_text.GetEffectiveTextPenWidth() + m_text.GetTextHeight();
EDA_ANGLE rotation;
if( crossbarCenter.x == 0 )
@ -667,8 +666,8 @@ void PCB_DIM_ALIGNED::updateText()
rotation = ANGLE_90;
VECTOR2I textOffset = crossbarCenter;
RotatePoint( crossbarCenter, rotation );
textOffset += crossbarCenter.Resize( textOffsetDistance );
RotatePoint( textOffset, rotation );
textOffset = crossbarCenter + textOffset.Resize( textOffsetDistance );
m_text.SetTextPos( m_crossBarStart + textOffset );
}