From ceb51bb103c09fedeefec24ebd9aed943e730e08 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sun, 15 Nov 2020 22:03:59 +0000 Subject: [PATCH] pcbnew: Only write fill flag for circles, rectangles and polygons The other shapes don't have the same concept of being filled (their fill is only a viewing mode, not an actual saved property). --- pcbnew/plugins/kicad/kicad_plugin.cpp | 28 +++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index 9ca6eb455a..dbf4dc05d8 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -841,11 +841,15 @@ void PCB_IO::format( PCB_SHAPE* aShape, int aNestLevel ) const m_out->Print( 0, " (width %s)", FormatInternalUnits( aShape->GetWidth() ).c_str() ); - // The filled flag represents if a solid fill is present - if( aShape->IsFilled() ) - m_out->Print( 0, " (fill solid)" ); - else - m_out->Print( 0, " (fill none)" ); + // The filled flag represents if a solid fill is present on circles, rectangles and polygons + if( ( aShape->GetShape() == S_POLYGON ) || ( aShape->GetShape() == S_RECT ) + || ( aShape->GetShape() == S_CIRCLE ) ) + { + if( aShape->IsFilled() ) + m_out->Print( 0, " (fill solid)" ); + else + m_out->Print( 0, " (fill none)" ); + } m_out->Print( 0, " (tstamp %s)", TO_UTF8( aShape->m_Uuid.AsString() ) ); @@ -932,11 +936,15 @@ void PCB_IO::format( FP_SHAPE* aFPShape, int aNestLevel ) const m_out->Print( 0, " (width %s)", FormatInternalUnits( aFPShape->GetWidth() ).c_str() ); - // The filled flag represents if a solid fill is present - if( aFPShape->IsFilled() ) - m_out->Print( 0, " (fill solid)" ); - else - m_out->Print( 0, " (fill none)" ); + // The filled flag represents if a solid fill is present on circles, rectangles and polygons + if( ( aFPShape->GetShape() == S_POLYGON ) || ( aFPShape->GetShape() == S_RECT ) + || ( aFPShape->GetShape() == S_CIRCLE ) ) + { + if( aFPShape->IsFilled() ) + m_out->Print( 0, " (fill solid)" ); + else + m_out->Print( 0, " (fill none)" ); + } m_out->Print( 0, " (tstamp %s)", TO_UTF8( aFPShape->m_Uuid.AsString() ) );