Turn off plotting hidden fields in the svg export cli

This commit is contained in:
Marek Roszko 2023-01-05 23:32:24 -05:00
parent e056c96c10
commit c57e6db79a
3 changed files with 15 additions and 12 deletions

View File

@ -394,7 +394,7 @@ int EESCHEMA_JOBS_HANDLER::doSymExportSvg( JOB_SYM_EXPORT_SVG* aSvgJob,
if( symbol )
{
constexpr bool background = true;
bool background = true;
TRANSFORM temp; // Uses default transform
VECTOR2I plotPos;
@ -402,14 +402,10 @@ int EESCHEMA_JOBS_HANDLER::doSymExportSvg( JOB_SYM_EXPORT_SVG* aSvgJob,
plotPos.y = pageInfo.GetHeightIU( schIUScale.IU_PER_MILS ) / 2;
symbol->Plot( plotter, unit, convert, background, plotPos, temp, false );
// Plot lib fields, not plotted by m_symbol->Plot():
symbol->PlotLibFields( plotter, unit, convert, background, plotPos, temp, false );
symbol->PlotLibFields( plotter, unit, convert, background, plotPos, temp, false, false );
symbol->Plot( plotter, unit, convert, !background, plotPos, temp, false );
// Plot lib fields, not plotted by m_symbol->Plot():
symbol->PlotLibFields( plotter, unit, convert, !background, plotPos, temp, false );
symbol->PlotLibFields( plotter, unit, convert, !background, plotPos, temp, false, false );
}
plotter->EndPlot();
@ -424,7 +420,10 @@ int EESCHEMA_JOBS_HANDLER::JobSymExportSvg( JOB* aJob )
{
JOB_SYM_EXPORT_SVG* svgJob = dynamic_cast<JOB_SYM_EXPORT_SVG*>( aJob );
SCH_SEXPR_PLUGIN_CACHE schLibrary( svgJob->m_libraryPath );
wxFileName fn( svgJob->m_libraryPath );
fn.MakeAbsolute();
SCH_SEXPR_PLUGIN_CACHE schLibrary( fn.GetFullPath() );
try
{

View File

@ -741,7 +741,8 @@ void LIB_SYMBOL::Plot( PLOTTER *aPlotter, int aUnit, int aConvert, bool aBackgro
void LIB_SYMBOL::PlotLibFields( PLOTTER* aPlotter, int aUnit, int aConvert, bool aBackground,
const VECTOR2I& aOffset, const TRANSFORM& aTransform, bool aDimmed )
const VECTOR2I& aOffset, const TRANSFORM& aTransform, bool aDimmed,
bool aPlotHidden )
{
wxASSERT( aPlotter != nullptr );
@ -761,6 +762,9 @@ void LIB_SYMBOL::PlotLibFields( PLOTTER* aPlotter, int aUnit, int aConvert, bool
if( item.Type() != LIB_FIELD_T )
continue;
if( !aPlotHidden && !( (LIB_FIELD&) item ).IsVisible() )
continue;
if( aUnit && item.m_unit && ( item.m_unit != aUnit ) )
continue;

View File

@ -370,7 +370,7 @@ public:
* @param aDimmed - reduce brightness of fields
*/
void PlotLibFields( PLOTTER* aPlotter, int aUnit, int aConvert, bool aBackground,
const VECTOR2I& aOffset, const TRANSFORM& aTransform, bool aDimmed );
const VECTOR2I& aOffset, const TRANSFORM& aTransform, bool aDimmed, bool aPlotHidden = true );
/**
* Add a new draw \a aItem to the draw object list and sort according to \a aSort.