Honour board's PAGE_INFO when plotting drill maps.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21393

(cherry picked from commit d7b5456dfbd022f8947c86bcfd26bfcfb917c8aa)
This commit is contained in:
Jeff Young 2025-07-28 20:06:42 +01:00
parent 149cac25f4
commit 7679413f2f
2 changed files with 4 additions and 3 deletions

View File

@ -446,6 +446,7 @@ void DIALOG_GENDRILL::genDrillAndMapFiles( bool aGenDrill, bool aGenMap )
excellonWriter.SetOptions( g_mirror, g_minimalHeader, g_drillFileOffset, g_merge_PTH_NPTH );
excellonWriter.SetRouteModeForOvalHoles( g_useRouteModeForOvalHoles );
excellonWriter.SetMapFileFormat( filefmt[choice] );
excellonWriter.SetPageInfo( &m_board->GetPageSettings() );
excellonWriter.CreateDrillandMapFilesSet( outputDir.GetFullPath(), aGenDrill, aGenMap,
&reporter );
@ -459,6 +460,7 @@ void DIALOG_GENDRILL::genDrillAndMapFiles( bool aGenDrill, bool aGenMap )
gerberWriter.SetFormat( m_plotOpts.GetGerberPrecision() );
gerberWriter.SetOptions( g_drillFileOffset );
gerberWriter.SetMapFileFormat( filefmt[choice] );
gerberWriter.SetPageInfo( &m_board->GetPageSettings() );
gerberWriter.CreateDrillandMapFilesSet( outputDir.GetFullPath(), aGenDrill, aGenMap,
&reporter );

View File

@ -134,8 +134,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
case PLOT_FORMAT::POST:
case PLOT_FORMAT::SVG:
{
PAGE_INFO pageA4( wxT( "A4" ) );
VECTOR2I pageSizeIU = pageA4.GetSizeIU( pcbIUScale.IU_PER_MILS );
VECTOR2I pageSizeIU = page_info.GetSizeIU( pcbIUScale.IU_PER_MILS );
// Reserve a 10 mm margin around the page.
int margin = pcbIUScale.mmToIU( 10 );
@ -170,7 +169,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
else
plotter = new PS_PLOTTER;
plotter->SetPageSettings( pageA4 );
plotter->SetPageSettings( page_info );
plotter->SetViewport( offset, pcbIUScale.IU_PER_MILS / 10, scale, false );
break;
}