PDF plotter: fix a rare pen width issue when plotting many pages in one file.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20805
This commit is contained in:
jean-pierre charras 2025-05-01 19:57:15 +02:00
parent 3a4ad0fb8b
commit a02f1f2411
2 changed files with 5 additions and 0 deletions

View File

@ -694,6 +694,10 @@ void PDF_PLOTTER::StartPage( const wxString& aPageNumber, const wxString& aPageN
m_paperSize.x *= 10.0 / m_iuPerDeviceUnit;
m_paperSize.y *= 10.0 / m_iuPerDeviceUnit;
// Set m_currentPenWidth to a unused value to ensure the pen width
// will be initialized to a the right value in pdf file by the first item to plot
m_currentPenWidth = 0;
// Open the content stream; the page object will go later
m_pageStreamHandle = startPdfStream();

View File

@ -1361,6 +1361,7 @@ 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& aLayerName, const wxString& aSheetName,
const wxString& aSheetPath, const wxString& aPageNumber,