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:
parent
2560c8f31b
commit
b184b43431
|
@ -246,6 +246,7 @@ bool DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_orientation.SetAngleValue( text.GetTextAngle() );
|
m_orientation.SetAngleValue( text.GetTextAngle() );
|
||||||
|
m_cbKeepAligned->SetValue( m_dimension->GetKeepTextAligned() );
|
||||||
|
|
||||||
m_bold->Check( text.IsBold() );
|
m_bold->Check( text.IsBold() );
|
||||||
m_italic->Check( text.IsItalic() );
|
m_italic->Check( text.IsItalic() );
|
||||||
|
|
|
@ -656,7 +656,6 @@ void PCB_DIM_ALIGNED::updateText()
|
||||||
if( m_textPosition == DIM_TEXT_POSITION::OUTSIDE )
|
if( m_textPosition == DIM_TEXT_POSITION::OUTSIDE )
|
||||||
{
|
{
|
||||||
int textOffsetDistance = m_text.GetEffectiveTextPenWidth() + m_text.GetTextHeight();
|
int textOffsetDistance = m_text.GetEffectiveTextPenWidth() + m_text.GetTextHeight();
|
||||||
|
|
||||||
EDA_ANGLE rotation;
|
EDA_ANGLE rotation;
|
||||||
|
|
||||||
if( crossbarCenter.x == 0 )
|
if( crossbarCenter.x == 0 )
|
||||||
|
@ -667,8 +666,8 @@ void PCB_DIM_ALIGNED::updateText()
|
||||||
rotation = ANGLE_90;
|
rotation = ANGLE_90;
|
||||||
|
|
||||||
VECTOR2I textOffset = crossbarCenter;
|
VECTOR2I textOffset = crossbarCenter;
|
||||||
RotatePoint( crossbarCenter, rotation );
|
RotatePoint( textOffset, rotation );
|
||||||
textOffset += crossbarCenter.Resize( textOffsetDistance );
|
textOffset = crossbarCenter + textOffset.Resize( textOffsetDistance );
|
||||||
|
|
||||||
m_text.SetTextPos( m_crossBarStart + textOffset );
|
m_text.SetTextPos( m_crossBarStart + textOffset );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue