Commit cac99516 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: Fix 2 minor bugs about pcb texts: flipped texts have an incorrect rotation angle,

and text dialog editor did not handle properly negative rotation angles values.
Eeschema: fix bug when rotating (only using the Rotate hotkey) a field.
parents e6681f17 538b1ed3
This diff is collapsed.
......@@ -595,13 +595,15 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
case SCH_FIELD_T:
cmd.SetId( ID_POPUP_SCH_ROTATE_FIELD );
wxPostEvent( this, cmd );
break;
case SCH_BITMAP_T:
cmd.SetId( ID_POPUP_SCH_ROTATE_IMAGE );
wxPostEvent( this, cmd );
break;
default:
;
break;
}
break;
......
......@@ -305,10 +305,7 @@ void TEXTE_PCB::Rotate(const wxPoint& aRotCentre, int aAngle)
{
RotatePoint( &m_Pos, aRotCentre, aAngle );
m_Orient += aAngle;
while( m_Orient >= 3600 )
m_Orient -= 3600;
while( m_Orient < -3600 )
m_Orient += 3600;
NORMALIZE_ANGLE_360( m_Orient );
}
......@@ -320,7 +317,7 @@ void TEXTE_PCB::Rotate(const wxPoint& aRotCentre, int aAngle)
void TEXTE_PCB::Flip(const wxPoint& aCentre )
{
m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y );
NEGATE( m_Orient );
// NEGATE( m_Orient ); not needed: m_Mirror handles this
if( ( GetLayer() == LAYER_N_BACK ) || ( GetLayer() == LAYER_N_FRONT ) )
{
m_Mirror = not m_Mirror; /* inverse mirror */
......
......@@ -120,12 +120,15 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
m_OrientationCtrl->SetSelection( 0 );
break;
case 900:
case -2700:
m_OrientationCtrl->SetSelection( 1 );
break;
case 1800:
case -1800:
m_OrientationCtrl->SetSelection( 2 );
break;
case 2700:
case -900:
m_OrientationCtrl->SetSelection( 3 );
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment