Fix text rotation after flip

fixes https://gitlab.com/kicad/code/kicad/-/issues/4407

(cherry picked from commit 9cf1e61d8a)
This commit is contained in:
Frank Severinsen 2020-05-15 21:17:24 +00:00 committed by Jon Evans
parent 7194e25bba
commit 910605cc7d
1 changed files with 7 additions and 0 deletions

View File

@ -176,6 +176,13 @@ void TEXTE_PCB::Flip( const wxPoint& aCentre )
SetLayer( FlipLayer( GetLayer(), copperLayerCount ) );
SetMirrored( !IsMirrored() );
double text_angle = GetTextAngle();
if( text_angle < 1800 )
text_angle = 1800 - text_angle;
else
text_angle = 3600 - text_angle + 1800;
SetTextAngle( text_angle );
// adjust justified text for mirroring
if( GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT || GetHorizJustify() == GR_TEXT_HJUSTIFY_RIGHT )
{