diff --git a/pcbnew/dialogs/dialog_export_idf.cpp b/pcbnew/dialogs/dialog_export_idf.cpp index 0f5ebe7451..ae693ced78 100644 --- a/pcbnew/dialogs/dialog_export_idf.cpp +++ b/pcbnew/dialogs/dialog_export_idf.cpp @@ -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 { diff --git a/pcbnew/dialogs/dialog_export_vrml.cpp b/pcbnew/dialogs/dialog_export_vrml.cpp index 54bd605c59..4e877a0788 100644 --- a/pcbnew/dialogs/dialog_export_vrml.cpp +++ b/pcbnew/dialogs/dialog_export_vrml.cpp @@ -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