Prefer -90 to 270 for text rotation in dialog boxes.

Fixes https://gitlab.com/kicad/code/kicad/issues/9868
This commit is contained in:
Jeff Young 2022-04-10 22:43:09 +01:00
parent 1dae5eb7c4
commit 32a2490677
4 changed files with 13 additions and 9 deletions

View File

@ -245,7 +245,8 @@ bool DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow()
m_txtTextPosY->Disable();
}
m_orientation.SetAngleValue( text.GetTextAngle() );
EDA_ANGLE orientation = text.GetTextAngle();
m_orientation.SetAngleValue( orientation.Normalize180() );
m_cbKeepAligned->SetValue( m_dimension->GetKeepTextAligned() );
m_bold->Check( text.IsBold() );
@ -418,7 +419,7 @@ void DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog( PCB_DIMENSION_BASE*
aTarget->SetKeepTextAligned( m_cbKeepAligned->GetValue() );
text.SetTextAngle( m_orientation.GetAngleValue() );
text.SetTextAngle( m_orientation.GetAngleValue().Normalize() );
text.SetTextWidth( m_textWidth.GetValue() );
text.SetTextHeight( m_textHeight.GetValue() );
text.SetTextThickness( m_textThickness.GetValue() );

View File

@ -268,7 +268,8 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow()
m_BoardSideCtrl->SetSelection( (m_footprint->GetLayer() == B_Cu) ? 1 : 0 );
m_orientation.SetAngleValue( m_footprint->GetOrientation() );
EDA_ANGLE orientation = m_footprint->GetOrientation();
m_orientation.SetAngleValue( orientation.Normalize180() );
m_cbLocked->SetValue( m_footprint->IsLocked() );
m_cbLocked->SetToolTip( _( "Locked footprints cannot be freely moved and oriented on the "
@ -463,7 +464,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow()
m_footprint->SetAttributes( attributes );
EDA_ANGLE orient = m_orientation.GetAngleValue();
EDA_ANGLE orient = m_orientation.GetAngleValue().Normalize();
if( m_footprint->GetOrientation() != orient )
m_footprint->Rotate( m_footprint->GetPosition(), orient - m_footprint->GetOrientation() );

View File

@ -286,7 +286,8 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow()
m_mirrored->Check( m_edaText->IsMirrored() );
m_orientation.SetAngleValue( m_edaText->GetTextAngle() );
EDA_ANGLE orientation = m_edaText->GetTextAngle();
m_orientation.SetAngleValue( orientation.Normalize180() );
return DIALOG_TEXT_PROPERTIES_BASE::TransferDataToWindow();
}
@ -421,7 +422,7 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
m_edaText->SetTextThickness( maxPenWidth );
}
m_edaText->SetTextAngle( m_orientation.GetAngleValue() );
m_edaText->SetTextAngle( m_orientation.GetAngleValue().Normalize() );
m_edaText->SetVisible( m_Visible->GetValue() );

View File

@ -192,7 +192,8 @@ bool DIALOG_TEXTBOX_PROPERTIES::TransferDataToWindow()
m_mirrored->Check( m_edaText->IsMirrored() );
m_orientation.SetAngleValue( m_edaText->GetTextAngle() );
EDA_ANGLE orientation = m_edaText->GetTextAngle();
m_orientation.SetAngleValue( orientation.Normalize180() );
STROKE_PARAMS stroke;
@ -354,14 +355,14 @@ bool DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow()
m_edaText->SetTextThickness( maxPenWidth );
}
EDA_ANGLE delta = m_orientation.GetAngleValue() - m_edaText->GetTextAngle();
EDA_ANGLE delta = m_orientation.GetAngleValue().Normalize() - 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->SetTextAngle( m_orientation.GetAngleValue().Normalize() );
m_edaText->SetBold( m_bold->IsChecked() );
m_edaText->SetItalic( m_italic->IsChecked() );