PCB_TEXT::Rotate(): ensure the final orientation is -180 ... +180 deg

This commit is contained in:
jean-pierre charras 2022-02-01 18:06:58 +01:00
parent 1440c0a2d2
commit e560e765e6
2 changed files with 7 additions and 2 deletions

View File

@ -126,7 +126,10 @@ void FP_TEXT::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
RotatePoint( pt, aRotCentre, aAngle );
SetTextPos( pt );
SetTextAngle( GetTextAngle() + aAngle );
EDA_ANGLE new_angle = GetTextAngle() + aAngle;
new_angle.Normalize180();
SetTextAngle( new_angle );
SetLocalCoord();
}

View File

@ -160,7 +160,9 @@ void PCB_TEXT::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
RotatePoint( pt, aRotCentre, aAngle );
SetTextPos( pt );
SetTextAngle( GetTextAngle() + aAngle );
EDA_ANGLE new_angle = GetTextAngle() + aAngle;
new_angle.Normalize180();
SetTextAngle( new_angle );
}