From 9cf1e61d8a4180de28c727510d4dca6bbfc8167d Mon Sep 17 00:00:00 2001 From: Frank Severinsen Date: Fri, 15 May 2020 21:17:24 +0000 Subject: [PATCH] Fix text rotation after flip fixes https://gitlab.com/kicad/code/kicad/-/issues/4407 --- pcbnew/class_pcb_text.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index 0b2fdbdcb2..da843f0f04 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -177,6 +177,13 @@ void TEXTE_PCB::Flip( const wxPoint& aCentre, bool aFlipLeftRight ) 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 ) {