Save and load fill color of SHAPE_T objects properly
This commit is contained in:
parent
09b7e0b72b
commit
80e7b6eb1f
|
@ -959,6 +959,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseArc()
|
|||
case T_fill:
|
||||
parseFill( fill );
|
||||
arc->SetFillMode( fill.m_FillType );
|
||||
arc->SetFillColor( fill.m_Color );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1058,6 +1059,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseBezier()
|
|||
case T_fill:
|
||||
parseFill( fill );
|
||||
bezier->SetFillMode( fill.m_FillType );
|
||||
bezier->SetFillColor( fill.m_Color );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1114,6 +1116,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseCircle()
|
|||
case T_fill:
|
||||
parseFill( fill );
|
||||
circle->SetFillMode( fill.m_FillType );
|
||||
circle->SetFillColor( fill.m_Color );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1386,6 +1389,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parsePolyLine()
|
|||
case T_fill:
|
||||
parseFill( fill );
|
||||
poly->SetFillMode( fill.m_FillType );
|
||||
poly->SetFillColor( fill.m_Color );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1437,6 +1441,7 @@ LIB_SHAPE* SCH_SEXPR_PARSER::parseRectangle()
|
|||
case T_fill:
|
||||
parseFill( fill );
|
||||
rectangle->SetFillMode( fill.m_FillType );
|
||||
rectangle->SetFillColor( fill.m_Color );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -1976,6 +1976,8 @@ void SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem( LIB_ITEM* aItem, OUTPUTFORMATTE
|
|||
|
||||
stroke.SetWidth( shape->GetWidth() );
|
||||
|
||||
COLOR4D fillColor = shape->GetFillColor();
|
||||
|
||||
switch( shape->GetShape() )
|
||||
{
|
||||
case SHAPE_T::ARC:
|
||||
|
@ -1984,23 +1986,23 @@ void SCH_SEXPR_PLUGIN_CACHE::saveSymbolDrawItem( LIB_ITEM* aItem, OUTPUTFORMATTE
|
|||
|
||||
shape->CalcArcAngles( x1, x2 );
|
||||
|
||||
formatArc( &aFormatter, aNestLevel, shape, x1, x2, stroke, fillMode, COLOR4D() );
|
||||
formatArc( &aFormatter, aNestLevel, shape, x1, x2, stroke, fillMode, fillColor );
|
||||
break;
|
||||
|
||||
case SHAPE_T::CIRCLE:
|
||||
formatCircle( &aFormatter, aNestLevel, shape, stroke, fillMode, COLOR4D() );
|
||||
formatCircle( &aFormatter, aNestLevel, shape, stroke, fillMode, fillColor );
|
||||
break;
|
||||
|
||||
case SHAPE_T::RECT:
|
||||
formatRect( &aFormatter, aNestLevel, shape, stroke, fillMode, COLOR4D() );
|
||||
formatRect( &aFormatter, aNestLevel, shape, stroke, fillMode, fillColor );
|
||||
break;
|
||||
|
||||
case SHAPE_T::BEZIER:
|
||||
formatBezier(&aFormatter, aNestLevel, shape, stroke, fillMode, COLOR4D() );
|
||||
formatBezier(&aFormatter, aNestLevel, shape, stroke, fillMode, fillColor );
|
||||
break;
|
||||
|
||||
case SHAPE_T::POLY:
|
||||
formatPoly( &aFormatter, aNestLevel, shape, stroke, fillMode, COLOR4D() );
|
||||
formatPoly( &aFormatter, aNestLevel, shape, stroke, fillMode, fillColor );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue