Fix bugs in B&W plotting.
Fixes https://gitlab.com/kicad/code/kicad/issues/9411
This commit is contained in:
parent
dd99b2dc2f
commit
3d2ffc12c1
|
@ -893,7 +893,7 @@ void DIALOG_PLOT_SCHEMATIC::restoreEnvironment( PDF_PLOTTER* aPlotter,
|
|||
void DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
|
||||
bool aPlotDrawingSheet )
|
||||
{
|
||||
if( m_plotBackgroundColor->GetValue() )
|
||||
if( m_plotBackgroundColor->GetValue() && aPlotter->GetColorMode() )
|
||||
{
|
||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetBackgroundColor() );
|
||||
wxPoint end( aPlotter->PageSettings().GetWidthIU(),
|
||||
|
@ -1084,7 +1084,7 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetPS( const wxString& aFileName,
|
|||
|
||||
plotter->StartPlot();
|
||||
|
||||
if( m_plotBackgroundColor->GetValue() )
|
||||
if( m_plotBackgroundColor->GetValue() && plotter->GetColorMode() )
|
||||
{
|
||||
plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
|
||||
wxPoint end( plotter->PageSettings().GetWidthIU(), plotter->PageSettings().GetHeightIU() );
|
||||
|
@ -1213,7 +1213,7 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG( const wxString& aFileName,
|
|||
|
||||
plotter->StartPlot();
|
||||
|
||||
if( m_plotBackgroundColor->GetValue() )
|
||||
if( m_plotBackgroundColor->GetValue() && plotter->GetColorMode() )
|
||||
{
|
||||
plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
|
||||
wxPoint end( plotter->PageSettings().GetWidthIU(),
|
||||
|
|
|
@ -550,14 +550,14 @@ void LIB_SYMBOL::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint
|
|||
wxASSERT( aPlotter != nullptr );
|
||||
|
||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
||||
bool fill = aPlotter->GetColorMode();
|
||||
|
||||
// draw background for filled items using background option
|
||||
// Solid lines will be drawn after the background
|
||||
for( const LIB_ITEM& item : m_drawings )
|
||||
{
|
||||
if( item.Type() == LIB_SHAPE_T )
|
||||
{
|
||||
if( item.Type() != LIB_SHAPE_T )
|
||||
continue;
|
||||
|
||||
const LIB_SHAPE& shape = static_cast<const LIB_SHAPE&>( item );
|
||||
|
||||
// Do not draw items not attached to the current part
|
||||
|
@ -567,9 +567,8 @@ void LIB_SYMBOL::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint
|
|||
if( aConvert && shape.m_convert && ( shape.m_convert != aConvert ) )
|
||||
continue;
|
||||
|
||||
if( shape.GetFillType() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
|
||||
shape.Plot( aPlotter, aOffset, fill, aTransform );
|
||||
}
|
||||
if( shape.GetFillType() == FILL_T::FILLED_WITH_BG_BODYCOLOR && aPlotter->GetColorMode() )
|
||||
shape.Plot( aPlotter, aOffset, true, aTransform );
|
||||
}
|
||||
|
||||
// Not filled items and filled shapes are now plotted
|
||||
|
@ -595,7 +594,7 @@ void LIB_SYMBOL::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint
|
|||
forceNoFill = shape.GetFillType() == FILL_T::FILLED_WITH_BG_BODYCOLOR;
|
||||
}
|
||||
|
||||
item.Plot( aPlotter, aOffset, fill && !forceNoFill, aTransform );
|
||||
item.Plot( aPlotter, aOffset, !forceNoFill, aTransform );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue