Do not round a rotation angle to 0.1 degree.

Also ensure the rotation angle is not truncated when displaying
info for Footprints and Pads

Fixes #6058
https://gitlab.com/kicad/code/kicad/issues/6058
This commit is contained in:
jean-pierre charras 2020-10-30 17:59:04 +01:00
parent 9065908859
commit 536bba294b
3 changed files with 4 additions and 4 deletions

View File

@ -776,7 +776,7 @@ void MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM
aList.emplace_back( _( "Status: " ) + status, _( "Attributes:" ) + wxS( " " ) + attrs, BROWN ); aList.emplace_back( _( "Status: " ) + status, _( "Attributes:" ) + wxS( " " ) + attrs, BROWN );
msg.Printf( "%.2f", GetOrientationDegrees() ); msg.Printf( "%.4g", GetOrientationDegrees() );
aList.emplace_back( _( "Rotation" ), msg, BROWN ); aList.emplace_back( _( "Rotation" ), msg, BROWN );
msg.Printf( _( "Footprint: %s" ), m_fpid.Format().c_str() ); msg.Printf( _( "Footprint: %s" ), m_fpid.Format().c_str() );

View File

@ -870,9 +870,9 @@ void D_PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>
pad_orient_degrees = NormalizeAngleDegrees( pad_orient_degrees, -180.0, +180.0 ); pad_orient_degrees = NormalizeAngleDegrees( pad_orient_degrees, -180.0, +180.0 );
if( module_orient_degrees != 0.0 ) if( module_orient_degrees != 0.0 )
msg.Printf( wxT( "%.2f(+ %.2f)" ), pad_orient_degrees, module_orient_degrees ); msg.Printf( wxT( "%.4g(+ %.4g)" ), pad_orient_degrees, module_orient_degrees );
else else
msg.Printf( wxT( "%.1f" ), GetOrientationDegrees() ); msg.Printf( wxT( "%.4g" ), GetOrientationDegrees() );
aList.push_back( MSG_PANEL_ITEM( _( "Rotation" ), msg, LIGHTBLUE ) ); aList.push_back( MSG_PANEL_ITEM( _( "Rotation" ), msg, LIGHTBLUE ) );

View File

@ -244,7 +244,7 @@ bool DIALOG_MOVE_EXACT::TransferDataFromWindow()
bool ok = GetTranslationInIU( translation, m_polarCoords->IsChecked() ); bool ok = GetTranslationInIU( translation, m_polarCoords->IsChecked() );
m_translation.x = KiROUND(translation.x); m_translation.x = KiROUND(translation.x);
m_translation.y = KiROUND(translation.y); m_translation.y = KiROUND(translation.y);
m_rotation = m_rotate.GetValue(); m_rotation = m_rotate.GetDoubleValue();
m_rotationAnchor = m_menuIDs[ m_anchorOptions->GetSelection() ]; m_rotationAnchor = m_menuIDs[ m_anchorOptions->GetSelection() ];
if( ok ) if( ok )