From 1d205e44429e14328790bbf228ad052236681dc2 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Thu, 13 Feb 2020 11:31:32 -0500 Subject: [PATCH] Fix points formatting in s-expression symbol library file formatter. --- eeschema/sch_sexpr_plugin.cpp | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/eeschema/sch_sexpr_plugin.cpp b/eeschema/sch_sexpr_plugin.cpp index cea118aa78..8568cb1c30 100644 --- a/eeschema/sch_sexpr_plugin.cpp +++ b/eeschema/sch_sexpr_plugin.cpp @@ -1446,9 +1446,11 @@ void SCH_SEXPR_PLUGIN_CACHE::saveBezier( LIB_BEZIER* aBezier, if( newLine == 4 ) { aFormatter.Print( 0, "\n" ); - aFormatter.Print( aNestLevel + 2, "(xy %s %s)", + aFormatter.Print( aNestLevel + 3, " (xy %s %s)", FormatInternalUnits( pt.x ).c_str(), FormatInternalUnits( pt.y ).c_str() ); + newLine = 0; + lineCount += 1; } else { @@ -1457,15 +1459,7 @@ void SCH_SEXPR_PLUGIN_CACHE::saveBezier( LIB_BEZIER* aBezier, FormatInternalUnits( pt.y ).c_str() ); } - if( newLine < 4 ) - { - newLine += 1; - } - else - { - newLine = 0; - lineCount += 1; - } + newLine += 1; } if( lineCount == 1 ) @@ -1635,9 +1629,11 @@ void SCH_SEXPR_PLUGIN_CACHE::savePolyLine( LIB_POLYLINE* aPolyLine, if( newLine == 4 ) { aFormatter.Print( 0, "\n" ); - aFormatter.Print( aNestLevel + 2, "(xy %s %s)", + aFormatter.Print( aNestLevel + 3, " (xy %s %s)", FormatInternalUnits( pt.x ).c_str(), FormatInternalUnits( pt.y ).c_str() ); + newLine = 0; + lineCount += 1; } else { @@ -1646,15 +1642,7 @@ void SCH_SEXPR_PLUGIN_CACHE::savePolyLine( LIB_POLYLINE* aPolyLine, FormatInternalUnits( pt.y ).c_str() ); } - if( newLine < 4 ) - { - newLine += 1; - } - else - { - newLine = 0; - lineCount += 1; - } + newLine += 1; } if( lineCount == 1 )