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,
|
void DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
|
||||||
bool aPlotDrawingSheet )
|
bool aPlotDrawingSheet )
|
||||||
{
|
{
|
||||||
if( m_plotBackgroundColor->GetValue() )
|
if( m_plotBackgroundColor->GetValue() && aPlotter->GetColorMode() )
|
||||||
{
|
{
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetBackgroundColor() );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetBackgroundColor() );
|
||||||
wxPoint end( aPlotter->PageSettings().GetWidthIU(),
|
wxPoint end( aPlotter->PageSettings().GetWidthIU(),
|
||||||
|
@ -1084,7 +1084,7 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetPS( const wxString& aFileName,
|
||||||
|
|
||||||
plotter->StartPlot();
|
plotter->StartPlot();
|
||||||
|
|
||||||
if( m_plotBackgroundColor->GetValue() )
|
if( m_plotBackgroundColor->GetValue() && plotter->GetColorMode() )
|
||||||
{
|
{
|
||||||
plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
|
plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
|
||||||
wxPoint end( plotter->PageSettings().GetWidthIU(), plotter->PageSettings().GetHeightIU() );
|
wxPoint end( plotter->PageSettings().GetWidthIU(), plotter->PageSettings().GetHeightIU() );
|
||||||
|
@ -1213,7 +1213,7 @@ bool DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG( const wxString& aFileName,
|
||||||
|
|
||||||
plotter->StartPlot();
|
plotter->StartPlot();
|
||||||
|
|
||||||
if( m_plotBackgroundColor->GetValue() )
|
if( m_plotBackgroundColor->GetValue() && plotter->GetColorMode() )
|
||||||
{
|
{
|
||||||
plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
|
plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
|
||||||
wxPoint end( plotter->PageSettings().GetWidthIU(),
|
wxPoint end( plotter->PageSettings().GetWidthIU(),
|
||||||
|
|
|
@ -550,26 +550,25 @@ void LIB_SYMBOL::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint
|
||||||
wxASSERT( aPlotter != nullptr );
|
wxASSERT( aPlotter != nullptr );
|
||||||
|
|
||||||
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
aPlotter->SetColor( aPlotter->RenderSettings()->GetLayerColor( LAYER_DEVICE ) );
|
||||||
bool fill = aPlotter->GetColorMode();
|
|
||||||
|
|
||||||
// draw background for filled items using background option
|
// draw background for filled items using background option
|
||||||
// Solid lines will be drawn after the background
|
// Solid lines will be drawn after the background
|
||||||
for( const LIB_ITEM& item : m_drawings )
|
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
|
const LIB_SHAPE& shape = static_cast<const LIB_SHAPE&>( item );
|
||||||
if( aUnit && shape.m_unit && ( shape.m_unit != aUnit ) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if( aConvert && shape.m_convert && ( shape.m_convert != aConvert ) )
|
// Do not draw items not attached to the current part
|
||||||
continue;
|
if( aUnit && shape.m_unit && ( shape.m_unit != aUnit ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
if( shape.GetFillType() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
|
if( aConvert && shape.m_convert && ( shape.m_convert != aConvert ) )
|
||||||
shape.Plot( aPlotter, aOffset, fill, aTransform );
|
continue;
|
||||||
}
|
|
||||||
|
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
|
// 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;
|
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