From 576d70fab032a6384e5d68246ec5481897e877eb Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sun, 4 Jul 2021 12:08:40 -0400 Subject: [PATCH] Fix file format syntax of arcs in polygons No format bump as there is no way to create these files yet. --- pcbnew/plugins/kicad/kicad_plugin.cpp | 2 +- pcbnew/plugins/kicad/pcb_parser.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index 390ecc2db9..d58ca0f46c 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -856,7 +856,7 @@ void PCB_IO::format( const PCB_SHAPE* aShape, int aNestLevel ) const else { const SHAPE_ARC& arc = outline.Arc( ind ); - m_out->Print( aNestLevel, "%s(arc (start %s) (mid %s) (end %s)", + m_out->Print( aNestLevel, "%s(arc (start %s) (mid %s) (end %s))", nestLevel ? "" : " ", FormatInternalUnits( arc.GetP0() ).c_str(), FormatInternalUnits( arc.GetArcMid() ).c_str(), diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index 8bdf0dcfba..7cb0951f54 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -358,7 +358,9 @@ void PCB_PARSER::parseOutlinePoints( SHAPE_LINE_CHAIN& aPoly ) SHAPE_ARC arc( arc_start, arc_mid, arc_end, 0 ); aPoly.Append( arc ); - NeedRIGHT(); + + if( token != T_RIGHT ) + Expecting( T_RIGHT ); break; }