Eeschema: fix bug printing polygon (possibly other) filled shapes.

This commit is contained in:
Wayne Stambaugh 2021-11-01 16:09:32 -04:00
parent 4fe9f01eb0
commit bf85ddd577
1 changed files with 8 additions and 6 deletions

View File

@ -227,6 +227,7 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
int t1; int t1;
int t2; int t2;
COLOR4D color = aSettings->GetLayerColor( LAYER_DEVICE ); COLOR4D color = aSettings->GetLayerColor( LAYER_DEVICE );
COLOR4D fillColor = color;
unsigned ptCount = 0; unsigned ptCount = 0;
wxPoint* buffer = nullptr; wxPoint* buffer = nullptr;
@ -295,28 +296,29 @@ void LIB_SHAPE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset,
else else
{ {
if( GetFillType() == FILL_T::FILLED_WITH_BG_BODYCOLOR ) if( GetFillType() == FILL_T::FILLED_WITH_BG_BODYCOLOR )
color = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND ); fillColor = aSettings->GetLayerColor( LAYER_DEVICE_BACKGROUND );
switch( GetShape() ) switch( GetShape() )
{ {
case SHAPE_T::ARC: case SHAPE_T::ARC:
GRFilledArc( nullptr, DC, c.x, c.y, -t2, -t1, GetRadius(), penWidth, color, color ); GRFilledArc( nullptr, DC, c.x, c.y, -t2, -t1, GetRadius(), penWidth, color,
fillColor );
break; break;
case SHAPE_T::CIRCLE: case SHAPE_T::CIRCLE:
GRFilledCircle( nullptr, DC, pt1.x, pt1.y, GetRadius(), 0, color, color ); GRFilledCircle( nullptr, DC, pt1.x, pt1.y, GetRadius(), 0, color, fillColor );
break; break;
case SHAPE_T::RECT: case SHAPE_T::RECT:
GRFilledRect( nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, penWidth, color, color ); GRFilledRect( nullptr, DC, pt1.x, pt1.y, pt2.x, pt2.y, penWidth, color, fillColor );
break; break;
case SHAPE_T::POLY: case SHAPE_T::POLY:
GRPoly( nullptr, DC, ptCount, buffer, true, penWidth, color, color ); GRPoly( nullptr, DC, ptCount, buffer, true, penWidth, color, fillColor );
break; break;
case SHAPE_T::BEZIER: case SHAPE_T::BEZIER:
GRPoly( nullptr, DC, ptCount, buffer, true, penWidth, color, color ); GRPoly( nullptr, DC, ptCount, buffer, true, penWidth, color, fillColor );
break; break;
default: default: