7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 23:21:41 +00:00

Update layer per page.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20352
This commit is contained in:
Jeff Young 2025-03-17 09:48:46 +00:00
parent dd921354fc
commit 1848401d5b
3 changed files with 15 additions and 11 deletions

View File

@ -232,13 +232,15 @@ bool PCB_PLOTTER::Plot( const wxString& aOutputPath,
nextLayer = layersToPlot[nextI];
}
wxString pageName = m_board->GetLayerName( nextLayer );
wxString sheetName = layerName;
layerName = m_board->GetLayerName( nextLayer );
wxString pageName = layerName;
wxString sheetName = layerName;
static_cast<PDF_PLOTTER*>( plotter )->ClosePage();
static_cast<PDF_PLOTTER*>( plotter )->StartPage( pageNumber, pageName );
setupPlotterNewPDFPage( plotter, m_board, &m_plotOpts, sheetName, sheetPath,
pageNumber, finalPageCount );
setupPlotterNewPDFPage( plotter, m_board, &m_plotOpts, layerName, sheetName,
sheetPath, pageNumber, finalPageCount );
}
// last page

View File

@ -163,8 +163,9 @@ PLOTTER* StartPlotBoard( BOARD* aBoard, const PCB_PLOT_PARAMS* aPlotOpts, int aL
const int aPageCount = 1);
void setupPlotterNewPDFPage( PLOTTER* aPlotter, BOARD* aBoard, const PCB_PLOT_PARAMS* aPlotOpts,
const wxString& aSheetName, const wxString& aSheetPath,
const wxString& aPageNumber, int aPageCount );
const wxString& aLayerName, const wxString& aSheetName,
const wxString& aSheetPath, const wxString& aPageNumber,
int aPageCount );
/**
* Plot a sequence of board layer IDs.
*

View File

@ -1357,11 +1357,10 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aL
return nullptr;
}
void setupPlotterNewPDFPage( PLOTTER* aPlotter,
BOARD* aBoard,
const PCB_PLOT_PARAMS* aPlotOpts,
const wxString& aSheetName, const wxString& aSheetPath,
const wxString& aPageNumber, int aPageCount )
void setupPlotterNewPDFPage( PLOTTER* aPlotter, BOARD* aBoard, const PCB_PLOT_PARAMS* aPlotOpts,
const wxString& aLayerName, const wxString& aSheetName,
const wxString& aSheetPath, const wxString& aPageNumber,
int aPageCount )
{
// Plot the frame reference if requested
if( aPlotOpts->GetPlotFrameRef() )
@ -1375,4 +1374,6 @@ void setupPlotterNewPDFPage( PLOTTER* aPlotter,
if( aPlotOpts->GetMirror() )
initializePlotter( aPlotter, aBoard, aPlotOpts );
}
aPlotter->RenderSettings()->SetLayerName( aLayerName );
}