From 593a5181d705b0e513722bcda144d4d7c90ff56d Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 11 Apr 2019 19:17:17 -0400 Subject: [PATCH] Fix rotation of global and hierarchical labels Fixes: lp:1824432 * https://bugs.launchpad.net/kicad/+bug/1824432 --- eeschema/sch_text.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 475e29fa02..279fd43758 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -219,7 +219,14 @@ void SCH_TEXT::Rotate( wxPoint aPosition ) RotatePoint( &pt, aPosition, 900 ); SetTextPos( pt ); - SetLabelSpinStyle( (GetLabelSpinStyle() + 1) % 4 ); + int spin = GetLabelSpinStyle(); + + // Global and hierarchical labels spin backwards. Fix here because + // changing SetLabelSpinStyle would break existing designs. + if( this->Type() == SCH_GLOBAL_LABEL_T || this->Type() == SCH_HIERARCHICAL_LABEL_T ) + SetLabelSpinStyle( ( spin - 1 >= 0 ? ( spin - 1 ) : 3 ) ); + else + SetLabelSpinStyle( ( spin + 1 ) % 4 ); if( this->Type() == SCH_TEXT_T ) {