kicad-cli sym export svg: Ensure bounding box is correctly calculated
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18062
(cherry picked from commit 3e5ceaa319
)
Co-authored-by: Roberto Fernandez Bautista <roberto.fer.bau@gmail.com>
This commit is contained in:
parent
a53dd998b9
commit
ee3533baeb
|
@ -733,7 +733,7 @@ int EESCHEMA_JOBS_HANDLER::doSymExportSvg( JOB_SYM_EXPORT_SVG* aSvgJob,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the symbol bounding box to fit the plot page to it
|
// Get the symbol bounding box to fit the plot page to it
|
||||||
BOX2I symbolBB = symbol->Flatten()->GetUnitBoundingBox( unit, bodyStyle, false );
|
BOX2I symbolBB = symbol->Flatten()->GetUnitBoundingBox( unit, bodyStyle, !aSvgJob->m_includeHiddenFields );
|
||||||
PAGE_INFO pageInfo( PAGE_INFO::Custom );
|
PAGE_INFO pageInfo( PAGE_INFO::Custom );
|
||||||
pageInfo.SetHeightMils( schIUScale.IUToMils( symbolBB.GetHeight() * 1.2 ) );
|
pageInfo.SetHeightMils( schIUScale.IUToMils( symbolBB.GetHeight() * 1.2 ) );
|
||||||
pageInfo.SetWidthMils( schIUScale.IUToMils( symbolBB.GetWidth() * 1.2 ) );
|
pageInfo.SetWidthMils( schIUScale.IUToMils( symbolBB.GetWidth() * 1.2 ) );
|
||||||
|
@ -743,7 +743,7 @@ int EESCHEMA_JOBS_HANDLER::doSymExportSvg( JOB_SYM_EXPORT_SVG* aSvgJob,
|
||||||
plotter->SetPageSettings( pageInfo );
|
plotter->SetPageSettings( pageInfo );
|
||||||
plotter->SetColorMode( !aSvgJob->m_blackAndWhite );
|
plotter->SetColorMode( !aSvgJob->m_blackAndWhite );
|
||||||
|
|
||||||
VECTOR2I plot_offset;
|
VECTOR2I plot_offset = symbolBB.GetCenter();
|
||||||
const double scale = 1.0;
|
const double scale = 1.0;
|
||||||
|
|
||||||
// Currently, plot units are in decimal
|
// Currently, plot units are in decimal
|
||||||
|
|
Loading…
Reference in New Issue