diff --git a/common/plotters/common_plot_functions.cpp b/common/plotters/common_plot_functions.cpp index 127c16a767..926584a0e8 100644 --- a/common/plotters/common_plot_functions.cpp +++ b/common/plotters/common_plot_functions.cpp @@ -53,13 +53,17 @@ wxString GetDefaultPlotExtension( PlotFormat aFormat ) void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, const PAGE_INFO& aPageInfo, int aSheetNumber, int aNumberOfSheets, - const wxString &aSheetDesc, const wxString &aFilename ) + const wxString &aSheetDesc, const wxString &aFilename, const COLOR4D aColor ) { /* Note: Page sizes values are given in mils */ double iusPerMil = plotter->GetIUsPerDecimil() * 10.0; - COLOR4D plotColor = plotter->GetColorMode() ? COLOR4D( RED ) : COLOR4D::BLACK; + COLOR4D plotColor = plotter->GetColorMode() ? aColor : COLOR4D::BLACK; + + if( plotColor == COLOR4D::UNSPECIFIED ) + plotColor = COLOR4D( RED ); + plotter->SetColor( plotColor ); WS_DRAW_ITEM_LIST drawList; diff --git a/eeschema/plot_schematic_DXF.cpp b/eeschema/plot_schematic_DXF.cpp index c0f41771d6..ea7e184c30 100644 --- a/eeschema/plot_schematic_DXF.cpp +++ b/eeschema/plot_schematic_DXF.cpp @@ -136,7 +136,8 @@ bool DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF( const wxString& aFileName, m_parent->GetPageSettings(), aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens, m_parent->GetScreenDesc(), - aScreen->GetFileName() ); + aScreen->GetFileName(), + GetLayerColor( ( SCH_LAYER_ID )LAYER_WORKSHEET ) ); } aScreen->Plot( plotter ); diff --git a/eeschema/plot_schematic_HPGL.cpp b/eeschema/plot_schematic_HPGL.cpp index 449115c530..ed571a9539 100644 --- a/eeschema/plot_schematic_HPGL.cpp +++ b/eeschema/plot_schematic_HPGL.cpp @@ -208,7 +208,8 @@ bool DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL( const wxString& aFileName, m_parent->GetPageSettings(), aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens, m_parent->GetScreenDesc(), - aScreen->GetFileName() ); + aScreen->GetFileName(), + GetLayerColor( ( SCH_LAYER_ID )LAYER_WORKSHEET ) ); aScreen->Plot( plotter ); diff --git a/eeschema/plot_schematic_PDF.cpp b/eeschema/plot_schematic_PDF.cpp index f274087779..d7bc491156 100644 --- a/eeschema/plot_schematic_PDF.cpp +++ b/eeschema/plot_schematic_PDF.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -153,7 +154,8 @@ void DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF( PLOTTER* aPlotter, m_parent->GetPageSettings(), aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens, m_parent->GetScreenDesc(), - aScreen->GetFileName() ); + aScreen->GetFileName(), + GetLayerColor( ( SCH_LAYER_ID )LAYER_WORKSHEET ) ); } aScreen->Plot( aPlotter ); diff --git a/eeschema/plot_schematic_PS.cpp b/eeschema/plot_schematic_PS.cpp index 252c0a7178..d20e976609 100644 --- a/eeschema/plot_schematic_PS.cpp +++ b/eeschema/plot_schematic_PS.cpp @@ -162,7 +162,8 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetPS( const wxString& aFileName, m_parent->GetPageSettings(), aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens, m_parent->GetScreenDesc(), - aScreen->GetFileName() ); + aScreen->GetFileName(), + GetLayerColor( ( SCH_LAYER_ID )LAYER_WORKSHEET ) ); } aScreen->Plot( plotter ); diff --git a/eeschema/plot_schematic_SVG.cpp b/eeschema/plot_schematic_SVG.cpp index 74a1cf154d..6f551ca714 100644 --- a/eeschema/plot_schematic_SVG.cpp +++ b/eeschema/plot_schematic_SVG.cpp @@ -136,7 +136,8 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG( EDA_DRAW_FRAME* aFrame, aFrame->GetPageSettings(), aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens, aFrame->GetScreenDesc(), - aScreen->GetFileName() ); + aScreen->GetFileName(), + GetLayerColor( ( SCH_LAYER_ID )LAYER_WORKSHEET ) ); } aScreen->Plot( plotter ); diff --git a/include/plotter.h b/include/plotter.h index d7b64d373c..dfd521a84b 100644 --- a/include/plotter.h +++ b/include/plotter.h @@ -1352,7 +1352,8 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock, const PAGE_INFO& aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, - const wxString &aFilename ); + const wxString &aFilename, + const COLOR4D aColor = COLOR4D::UNSPECIFIED ); /** Returns the default plot extension for a format */