Only apply B&W printer fixes when printing.

Fixes https://gitlab.com/kicad/code/kicad/issues/7388
This commit is contained in:
Jeff Young 2021-02-02 15:36:45 +00:00
parent 90519c8324
commit b8e97bb6b6
7 changed files with 12 additions and 10 deletions

View File

@ -107,7 +107,7 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
// Set the color scheme
auto dstSettings = view->GetPainter()->GetSettings();
RENDER_SETTINGS* dstSettings = view->GetPainter()->GetSettings();
dstSettings->LoadColors( m_settings.m_colorSettings );
if( m_settings.m_blackWhite )
@ -126,6 +126,8 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
}
}
dstSettings->SetIsPrinting( true );
setupViewLayers( *view, m_settings.m_LayerSet );
setupPainter( *painter );

View File

@ -30,8 +30,7 @@
using namespace KIGFX;
PAINTER::PAINTER( GAL* aGal ) :
m_gal( aGal ),
m_brightenedColor( 0.0, 1.0, 0.0, 0.9 )
m_gal( aGal )
{
}

View File

@ -497,6 +497,8 @@ void SCH_PRINTOUT::PrintPage( SCH_SCREEN* aScreen )
wxEmptyString );
}
renderSettings.SetIsPrinting( true );
aScreen->Print( &renderSettings );
m_parent->SetDrawBgColor( savedBgColor );

View File

@ -99,9 +99,6 @@ protected:
/// Instance of graphic abstraction layer that gives an interface to call
/// commands used to draw (eg. DrawLine, DrawCircle, etc.)
GAL* m_gal;
/// Color of brightened item frame
COLOR4D m_brightenedColor;
};
} // namespace KIGFX

View File

@ -191,6 +191,9 @@ public:
bool GetShowPageLimits() const { return m_showPageLimits; }
void SetShowPageLimits( bool aDraw ) { m_showPageLimits = aDraw; }
bool IsPrinting() const { return m_isPrinting; }
void SetIsPrinting( bool isPrinting ) { m_isPrinting = isPrinting; }
/**
* Return current background color settings.
*/
@ -292,6 +295,7 @@ protected:
int m_minPenWidth; // Some clients (such as PDF) don't like ultra-thin
// lines. This sets an absolute minimum.
bool m_showPageLimits;
bool m_isPrinting;
wxDC* m_printDC; // This can go away once the worksheet is moved to
// Cairo-based printing.

View File

@ -77,9 +77,7 @@ PCB_RENDER_SETTINGS::PCB_RENDER_SETTINGS()
// By default everything should be displayed as filled
for( unsigned int i = 0; i < arrayDim( m_sketchMode ); ++i )
{
m_sketchMode[i] = false;
}
update();
}
@ -233,7 +231,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons
if( aLayer == LAYER_MARKER_SHADOWS )
return m_backgroundColor.WithAlpha( 0.6 );
if( IsHoleLayer( aLayer ) )
if( IsHoleLayer( aLayer ) && m_isPrinting )
{
// Careful that we don't end up with the same colour for the annular ring and the hole
// when printing in B&W.

View File

@ -292,7 +292,7 @@ protected:
virtual int getDrillSize( const VIA* aVia ) const;
protected:
PCB_RENDER_SETTINGS m_pcbSettings;
PCB_RENDER_SETTINGS m_pcbSettings;
};
} // namespace KIGFX