mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
svg_loader: code refactoring
unify to tvg fill rule.
This commit is contained in:
parent
2c24a1fa5e
commit
fcbc77bcdf
2 changed files with 5 additions and 11 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue