Eeschema: fix worksheet and background color for printing

Fixes: lp:1820611
* https://bugs.launchpad.net/kicad/+bug/1820611
This commit is contained in:
Jon Evans 2019-05-26 14:25:21 -04:00
parent e35be13b23
commit 720b26d11e
4 changed files with 17 additions and 9 deletions

View File

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

View File

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

View File

@ -430,18 +430,25 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
GRResetPenAndBrush( dc );
if( m_parent->GetPrintMonochrome() )
GRForceBlackPen( true );
aScreen->m_IsPrinting = true;
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, (GR_DRAWMODE) 0 );
if( printReference )
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 );
aScreen->m_IsPrinting = false;

View File

@ -746,7 +746,8 @@ public:
*/
void DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWidth,
double aScale, const wxString &aFilename,
const wxString &aSheetLayer = wxEmptyString );
const wxString &aSheetLayer = wxEmptyString,
COLOR4D aColor = COLOR4D::UNSPECIFIED );
void DisplayToolMsg( const wxString& msg );
virtual void RedrawActiveWindow( wxDC* DC, bool EraseBg ) = 0;