diff --git a/common/common_plotGERBER_functions.cpp b/common/common_plotGERBER_functions.cpp index 6c5b07bcfb..a13064b5db 100644 --- a/common/common_plotGERBER_functions.cpp +++ b/common/common_plotGERBER_functions.cpp @@ -43,6 +43,9 @@ void GERBER_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil, plotScale = 1; // Plot scale is *always* 1.0 m_IUsPerDecimil = aIusPerDecimil; + // gives now a default value to iuPerDeviceUnit (because the units of the caller is now known) + // which could be modified later by calling SetGerberCoordinatesFormat() + iuPerDeviceUnit = pow( 10.0, m_gerberUnitFmt ) / ( m_IUsPerDecimil * 10000.0 ); // We don't handle the filmbox, and it's more useful to keep the // origin at the origin diff --git a/pcbnew/exporters/gen_drill_report_files.cpp b/pcbnew/exporters/gen_drill_report_files.cpp index 7c474553c3..5a2c6ad5fb 100644 --- a/pcbnew/exporters/gen_drill_report_files.cpp +++ b/pcbnew/exporters/gen_drill_report_files.cpp @@ -78,6 +78,7 @@ bool EXCELLON_WRITER::GenDrillMapFile( const wxString& aFullFileName, offset = GetOffset(); plotter = new GERBER_PLOTTER(); plotter->SetViewport( offset, IU_PER_DECIMILS, scale, false ); + plotter->SetGerberCoordinatesFormat( 5 ); // format x.5 unit = mm break; case PLOT_FORMAT_HPGL: // Scale for HPGL format.