From 68fa45dea0115ae23a8650eb6f6ce05448a2d42e Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 27 May 2024 21:05:54 +0200 Subject: [PATCH] Pcbnew, plot drill marks: fix incorrect plot drill mark in some cases. If a non copper layers is added to a copper layer for plot with drill marks, the drill mark was not visible (covered by shapes plotted from non copper layer). Now copper layers are plotted after the non copper layers. --- pcbnew/plot_board_layers.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 85d50b8208..8d9cd774cf 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -58,8 +58,30 @@ void PlotBoardLayers( BOARD* aBoard, PLOTTER* aPlotter, const LSEQ& aLayers, { wxCHECK( aBoard && aPlotter && aLayers.size(), /* void */ ); + // if a drill mark must be plotted, the copper layer needs to be plotted + // after other layers because the drill mark must be plotted as a filled + // white shape *after* all other shapes are plotted + bool plot_mark = aPlotOptions.GetDrillMarksType() != DRILL_MARKS::NO_DRILL_SHAPE; + for( LSEQ seq = aLayers; seq; ++seq ) + { + // copper layers with drill marks will be plotted after all other layers + if( *seq <= B_Cu && plot_mark ) + continue; + PlotOneBoardLayer( aBoard, aPlotter, *seq, aPlotOptions ); + } + + if( !plot_mark ) + return; + + for( LSEQ seq = aLayers; seq; ++seq ) + { + if( *seq > B_Cu ) // already plotted + continue; + + PlotOneBoardLayer( aBoard, aPlotter, *seq, aPlotOptions ); + } }