From bfdbf969c275e56a8d08b62561df6172afc72af6 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 27 Aug 2023 13:16:34 +0100 Subject: [PATCH] Handle DXF arcs with a flipped coord system. Fixes https://gitlab.com/kicad/code/kicad/-/issues/14905 (cherry picked from commit 75b160e83a2e007b29108a519f7cfd643125d734) --- pcbnew/import_gfx/dxf_import_plugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pcbnew/import_gfx/dxf_import_plugin.cpp b/pcbnew/import_gfx/dxf_import_plugin.cpp index 6ce65ff7ab..a96b51a3c0 100644 --- a/pcbnew/import_gfx/dxf_import_plugin.cpp +++ b/pcbnew/import_gfx/dxf_import_plugin.cpp @@ -543,6 +543,13 @@ void DXF_IMPORT_PLUGIN::addArc( const DL_ArcData& aData ) EDA_ANGLE startangle( aData.angle1, DEGREES_T ); EDA_ANGLE endangle( aData.angle2, DEGREES_T ); + if( ( arbAxis.GetScale().x < 0 ) != ( arbAxis.GetScale().y < 0 ) ) + { + startangle = ANGLE_180 - startangle; + endangle = ANGLE_180 - endangle; + std::swap( startangle, endangle ); + } + // Init arc start point VECTOR2D startPoint( aData.radius, 0.0 ); RotatePoint( startPoint, -startangle );