Don't write out non-explicit tenting

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18230
This commit is contained in:
Jon Evans 2024-06-18 17:49:00 -04:00
parent 1a1083def6
commit 81a1e9e83e
1 changed files with 16 additions and 13 deletions

View File

@ -2250,23 +2250,26 @@ void PCB_IO_KICAD_SEXPR::format( const PCB_TRACK* aTrack, int aNestLevel ) const
m_out->Print( 0, ")" ); m_out->Print( 0, ")" );
} }
bool front = via->Padstack().FrontOuterLayers().has_solder_mask.value_or( false ); std::optional<bool> front = via->Padstack().FrontOuterLayers().has_solder_mask;
bool back = via->Padstack().BackOuterLayers().has_solder_mask.value_or( false ); std::optional<bool> back = via->Padstack().BackOuterLayers().has_solder_mask;
if( front || back ) if( front.has_value() || back.has_value() )
{ {
m_out->Print( 0, " (tenting " ); if( front.value_or( false ) || back.value_or( false ) )
{
m_out->Print( 0, " (tenting " );
if( via->Padstack().FrontOuterLayers().has_solder_mask.value_or( false ) ) if( front.value_or( false ) )
m_out->Print( 0, " front" ); m_out->Print( 0, " front" );
if( via->Padstack().BackOuterLayers().has_solder_mask.value_or( false ) ) if( back.value_or( false ) )
m_out->Print( 0, " back" ); m_out->Print( 0, " back" );
m_out->Print( 0, ")" ); m_out->Print( 0, ")" );
} }
else else
{ {
m_out->Print( 0, " (tenting none)" ); m_out->Print( 0, " (tenting none)" );
}
} }
if( !isDefaultTeardropParameters( via->GetTeardropParams() ) ) if( !isDefaultTeardropParameters( via->GetTeardropParams() ) )