Allow printing backgrounds prior to foreground

Eeschema shows background fills on a different z-level than the rest of
the symbols/elements.  Print the backgrounds prior to the foregrounds in
order to preserve this view for print output

Fixes https://gitlab.com/kicad/code/kicad/issues/12559
This commit is contained in:
Seth Hillbrand
2022-10-02 13:23:54 -07:00
parent 2b387ae9c3
commit e055302a3c
9 changed files with 95 additions and 9 deletions
+34 -4
View File
@@ -241,14 +241,11 @@ int SCH_SHAPE::GetPenWidth() const
}
void SCH_SHAPE::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
void SCH_SHAPE::PrintBackground( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
{
int penWidth = GetPenWidth();
wxDC* DC = aSettings->GetPrintDC();
COLOR4D color;
penWidth = std::max( penWidth, aSettings->GetMinPenWidth() );
unsigned ptCount = 0;
VECTOR2I* buffer = nullptr;
@@ -305,6 +302,39 @@ void SCH_SHAPE::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset
}
}
}
void SCH_SHAPE::Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset )
{
int penWidth = GetPenWidth();
wxDC* DC = aSettings->GetPrintDC();
COLOR4D color;
penWidth = std::max( penWidth, aSettings->GetMinPenWidth() );
unsigned ptCount = 0;
VECTOR2I* buffer = nullptr;
if( GetShape() == SHAPE_T::POLY )
{
SHAPE_LINE_CHAIN poly = m_poly.Outline( 0 );
ptCount = poly.GetPointCount();
buffer = new VECTOR2I[ptCount];
for( unsigned ii = 0; ii < ptCount; ++ii )
buffer[ii] = poly.CPoint( ii );
}
else if( GetShape() == SHAPE_T::BEZIER )
{
ptCount = m_bezierPoints.size();
buffer = new VECTOR2I[ptCount];
for( size_t ii = 0; ii < ptCount; ++ii )
buffer[ii] = m_bezierPoints[ii];
}
if( GetStroke().GetColor() == COLOR4D::UNSPECIFIED )
color = aSettings->GetLayerColor( LAYER_NOTES );
else