Make VRML use board edge bounding box for parity with step

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15472
This commit is contained in:
Marek Roszko 2023-08-24 20:42:58 -04:00
parent 4497aaa3fa
commit a17cd9d054
2 changed files with 5 additions and 7 deletions

View File

@ -195,9 +195,8 @@ void PCB_EDIT_FRAME::OnExportIDF3( wxCommandEvent& event )
if( dlg.GetAutoAdjustOffset() )
{
BOX2I bbox = GetBoard()->GetBoardEdgesBoundingBox();
aXRef = bbox.Centre().x * pcbIUScale.MM_PER_IU;
aYRef = bbox.Centre().y * pcbIUScale.MM_PER_IU;
aXRef = pcbIUScale.IUTomm( bbox.GetCenter().x );
aYRef = pcbIUScale.IUTomm( bbox.GetCenter().y );
}
else
{

View File

@ -230,10 +230,9 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event )
if( dlg.GetOriginChoice() == 1 )
{
// Origin = board center:
BOARD* pcb = GetBoard();
VECTOR2I center = pcb->GetBoundingBox().GetCenter();
aXRef = pcbIUScale.IUTomm( center.x );
aYRef = pcbIUScale.IUTomm( center.y );
BOX2I bbox = GetBoard()->GetBoardEdgesBoundingBox();
aXRef = pcbIUScale.IUTomm( bbox.GetCenter().x );
aYRef = pcbIUScale.IUTomm( bbox.GetCenter().y );
}
double scale = scaleList[dlg.GetUnits()]; // final scale export