Fix rotation of global and hierarchical labels

Fixes: lp:1824432
* https://bugs.launchpad.net/kicad/+bug/1824432

(cherry picked from commit 593a5181d7)
This commit is contained in:
Jon Evans 2019-04-11 19:17:17 -04:00
parent 77706a7ea6
commit 078fdb9077
1 changed files with 8 additions and 1 deletions

View File

@ -220,7 +220,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 )
{