From c108d25897623412f12f32cdffa940367390edf1 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 2 Jan 2022 15:44:52 +0100 Subject: [PATCH] Fix mirroring tests issues in qa tests for eeschema --- eeschema/sch_text.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index e3333d398a..b678c44498 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -1572,10 +1572,19 @@ void SCH_GLOBALLABEL::MirrorHorizontally( int aCenter ) for( SCH_FIELD& field : m_fields ) { - if( field.GetHorizJustify() == GR_TEXT_H_ALIGN_LEFT ) - field.SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT ); - else - field.SetHorizJustify( GR_TEXT_H_ALIGN_LEFT ); + switch( field.GetHorizJustify() ) + { + case GR_TEXT_H_ALIGN_LEFT: + field.SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT ); + break; + + case GR_TEXT_H_ALIGN_CENTER: + break; + + case GR_TEXT_H_ALIGN_RIGHT: + field.SetHorizJustify( GR_TEXT_H_ALIGN_LEFT ); + break; + } VECTOR2I pos = field.GetTextPos(); VECTOR2I delta = old_pos - pos;