From 6d69fee097d567d3fcad9b42abea75d3f347f5c8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 6 May 2024 10:53:39 +0200 Subject: [PATCH] PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT(): ensure texts are not mirrored When not specified as mirrored, texts must be not mirrored. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17955 --- pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp index 0feeb24ffe..a86031ebce 100644 --- a/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp +++ b/pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr_parser.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2012 CERN - * Copyright (C) 2012-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2012-2024 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -487,9 +487,12 @@ void PCB_IO_KICAD_SEXPR_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) wxCHECK_RET( CurTok() == T_effects, wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as EDA_TEXT." ) ); - // These are not written out if center/center, so we have to make sure we start that way. + // These are not written out if center/center and/or no mirror, + // so we have to make sure we start that way. + // (these parameters will be set in T_justify section, when existing) aText->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER ); aText->SetVertJustify( GR_TEXT_V_ALIGN_CENTER ); + aText->SetMirrored( false ); // In version 20210606 the notation for overbars was changed from `~...~` to `~{...}`. // We need to convert the old syntax to the new one.