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, ...@@ -595,13 +595,15 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition,
case SCH_FIELD_T: case SCH_FIELD_T:
cmd.SetId( ID_POPUP_SCH_ROTATE_FIELD ); cmd.SetId( ID_POPUP_SCH_ROTATE_FIELD );
wxPostEvent( this, cmd ); wxPostEvent( this, cmd );
break;
case SCH_BITMAP_T: case SCH_BITMAP_T:
cmd.SetId( ID_POPUP_SCH_ROTATE_IMAGE ); cmd.SetId( ID_POPUP_SCH_ROTATE_IMAGE );
wxPostEvent( this, cmd ); wxPostEvent( this, cmd );
break;
default: default:
; break;
} }
break; break;
......
...@@ -305,10 +305,7 @@ void TEXTE_PCB::Rotate(const wxPoint& aRotCentre, int aAngle) ...@@ -305,10 +305,7 @@ void TEXTE_PCB::Rotate(const wxPoint& aRotCentre, int aAngle)
{ {
RotatePoint( &m_Pos, aRotCentre, aAngle ); RotatePoint( &m_Pos, aRotCentre, aAngle );
m_Orient += aAngle; m_Orient += aAngle;
while( m_Orient >= 3600 ) NORMALIZE_ANGLE_360( m_Orient );
m_Orient -= 3600;
while( m_Orient < -3600 )
m_Orient += 3600;
} }
...@@ -320,7 +317,7 @@ void TEXTE_PCB::Rotate(const wxPoint& aRotCentre, int aAngle) ...@@ -320,7 +317,7 @@ void TEXTE_PCB::Rotate(const wxPoint& aRotCentre, int aAngle)
void TEXTE_PCB::Flip(const wxPoint& aCentre ) void TEXTE_PCB::Flip(const wxPoint& aCentre )
{ {
m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y ); 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 ) ) if( ( GetLayer() == LAYER_N_BACK ) || ( GetLayer() == LAYER_N_FRONT ) )
{ {
m_Mirror = not m_Mirror; /* inverse mirror */ m_Mirror = not m_Mirror; /* inverse mirror */
......
...@@ -120,12 +120,15 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit() ...@@ -120,12 +120,15 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
m_OrientationCtrl->SetSelection( 0 ); m_OrientationCtrl->SetSelection( 0 );
break; break;
case 900: case 900:
case -2700:
m_OrientationCtrl->SetSelection( 1 ); m_OrientationCtrl->SetSelection( 1 );
break; break;
case 1800: case 1800:
case -1800:
m_OrientationCtrl->SetSelection( 2 ); m_OrientationCtrl->SetSelection( 2 );
break; break;
case 2700: case 2700:
case -900:
m_OrientationCtrl->SetSelection( 3 ); m_OrientationCtrl->SetSelection( 3 );
break; 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