Eeschema: fix worksheet and background color for printing

Fixes: lp:1820611
* https://bugs.launchpad.net/kicad/+bug/1820611

(cherry picked from commit 720b26d11e)
This commit is contained in:
Jon Evans 2019-05-26 14:25:21 -04:00
parent b40289c1bd
commit d2a2dea9c4
4 changed files with 17 additions and 9 deletions

View File

@ -1223,7 +1223,7 @@ void DrawPageLayout( wxDC* aDC,
void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth, void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
double aScalar, const wxString &aFilename, double aScalar, const wxString &aFilename,
const wxString &aSheetLayer ) const wxString &aSheetLayer, COLOR4D aColor )
{ {
if( !m_showBorderAndTitleBlock ) if( !m_showBorderAndTitleBlock )
return; return;
@ -1240,7 +1240,7 @@ void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWi
} }
TITLE_BLOCK t_block = GetTitleBlock(); TITLE_BLOCK t_block = GetTitleBlock();
COLOR4D color = COLOR4D( RED ); COLOR4D color = ( aColor != COLOR4D::UNSPECIFIED ) ? aColor : COLOR4D( RED );
wxPoint origin = aDC->GetDeviceOrigin(); wxPoint origin = aDC->GetDeviceOrigin();

View File

@ -2055,7 +2055,7 @@ void DrawPageLayout( wxDC* aDC,
void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth, void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
double aScalar, const wxString &aFilename, double aScalar, const wxString &aFilename,
const wxString &aSheetLayer ) const wxString &aSheetLayer, COLOR4D aColor )
{ {
if( !m_showBorderAndTitleBlock ) if( !m_showBorderAndTitleBlock )
return; return;
@ -2073,7 +2073,7 @@ void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWi
} }
TITLE_BLOCK t_block = GetTitleBlock(); TITLE_BLOCK t_block = GetTitleBlock();
COLOR4D color = COLOR4D( RED ); COLOR4D color = ( aColor != COLOR4D::UNSPECIFIED ) ? aColor : COLOR4D( RED );
wxPoint origin = aDC->GetDeviceOrigin(); wxPoint origin = aDC->GetDeviceOrigin();

View File

@ -431,18 +431,25 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
GRSetDrawMode( dc, GR_DEFAULT_DRAWMODE ); GRSetDrawMode( dc, GR_DEFAULT_DRAWMODE );
GRResetPenAndBrush( dc ); GRResetPenAndBrush( dc );
if( m_parent->GetPrintMonochrome() )
GRForceBlackPen( true );
aScreen->m_IsPrinting = true; aScreen->m_IsPrinting = true;
COLOR4D bgColor = m_parent->GetDrawBgColor(); COLOR4D bgColor = m_parent->GetDrawBgColor();
m_parent->SetDrawBgColor( COLOR4D::WHITE );
GRSetDrawMode( dc, GR_COPY );
GRSFilledRect( nullptr, dc, fitRect.GetX(), fitRect.GetY(),
fitRect.GetRight(), fitRect.GetBottom(),
0, COLOR4D::WHITE, COLOR4D::WHITE );
if( m_parent->GetPrintMonochrome() )
GRForceBlackPen( true );
aScreen->Draw( panel, dc ); aScreen->Draw( panel, dc );
if( printReference ) if( printReference )
m_parent->DrawWorkSheet( dc, aScreen, GetDefaultLineThickness(), m_parent->DrawWorkSheet( dc, aScreen, GetDefaultLineThickness(),
IU_PER_MILS, aScreen->GetFileName() ); IU_PER_MILS, aScreen->GetFileName(), wxEmptyString,
GetLayerColor( ( SCH_LAYER_ID )LAYER_WORKSHEET ) );
m_parent->SetDrawBgColor( bgColor ); m_parent->SetDrawBgColor( bgColor );
aScreen->m_IsPrinting = false; aScreen->m_IsPrinting = false;

View File

@ -745,7 +745,8 @@ public:
*/ */
void DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth, void DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
double aScale, const wxString &aFilename, double aScale, const wxString &aFilename,
const wxString &aSheetLayer = wxEmptyString ); const wxString &aSheetLayer = wxEmptyString,
COLOR4D aColor = COLOR4D::UNSPECIFIED );
void DisplayToolMsg( const wxString& msg ); void DisplayToolMsg( const wxString& msg );
wxString GetToolMsg() { return m_toolMsg; } wxString GetToolMsg() { return m_toolMsg; }