From d5eb24229532e189fe3e888b3d8688341fec8c7c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 22 Feb 2023 16:19:08 +0100 Subject: [PATCH] Fix incorrect tilt of italic texts when plotting them. Fixes #14023 https://gitlab.com/kicad/code/kicad/issues/14023 --- common/plotters/plotter.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/plotters/plotter.cpp b/common/plotters/plotter.cpp index 312a35af41..78df76b157 100644 --- a/common/plotters/plotter.cpp +++ b/common/plotters/plotter.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2017-2023 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 @@ -759,6 +759,13 @@ void PLOTTER::Text( const VECTOR2I& aPos, attributes.m_Valign = aV_justify; attributes.m_Size = aSize; + // if Size.x is < 0, the text is mirrored (we have no other param to know a text is mirrored) + if( attributes.m_Size.x < 0 ) + { + attributes.m_Size.x = -attributes.m_Size.x; + attributes.m_Mirrored = true; + } + if( !aFont ) aFont = KIFONT::FONT::GetFont();