svg_loader: code refactoring

unify to tvg fill rule.
This commit is contained in:
Hermet Park 2021-06-30 14:16:27 +09:00 committed by Hermet Park
parent 2c24a1fa5e
commit fcbc77bcdf
2 changed files with 5 additions and 11 deletions

View file

@ -228,14 +228,14 @@ _PARSE_TAG(StrokeJoin, lineJoin, LineJoin, lineJoinTags, StrokeJoin::Miter)
*/
static constexpr struct
{
SvgFillRule fillRule;
FillRule fillRule;
const char* tag;
} fillRuleTags[] = {
{ SvgFillRule::OddEven, "evenodd" }
{ FillRule::EvenOdd, "evenodd" }
};
_PARSE_TAG(SvgFillRule, fillRule, FillRule, fillRuleTags, SvgFillRule::Winding)
_PARSE_TAG(FillRule, fillRule, FillRule, fillRuleTags, FillRule::Winding)
/* parse the dash pattern used during stroking a path.
@ -1039,7 +1039,7 @@ static SvgNode* _createNode(SvgNode* parent, SvgNodeType type)
node->style->fill.paint.curColor = false;
node->style->curColorSet = false;
//Default fill rule is nonzero
node->style->fill.fillRule = SvgFillRule::Winding;
node->style->fill.fillRule = FillRule::Winding;
//Default stroke is none
node->style->stroke.paint.none = true;

View file

@ -91,12 +91,6 @@ enum class SvgGradientType
Radial
};
enum class SvgFillRule
{
Winding = 0,
OddEven = 1
};
//Length type to recalculate %, pt, pc, mm, cm etc
enum class SvgParserLengthType
{
@ -238,7 +232,7 @@ struct SvgStyleFill
SvgFillFlags flags;
SvgPaint paint;
int opacity;
SvgFillRule fillRule;
FillRule fillRule;
};
struct SvgStyleStroke