mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 14:13: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
|
static constexpr struct
|
||||||
{
|
{
|
||||||
SvgFillRule fillRule;
|
FillRule fillRule;
|
||||||
const char* tag;
|
const char* tag;
|
||||||
} fillRuleTags[] = {
|
} 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.
|
/* 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->fill.paint.curColor = false;
|
||||||
node->style->curColorSet = false;
|
node->style->curColorSet = false;
|
||||||
//Default fill rule is nonzero
|
//Default fill rule is nonzero
|
||||||
node->style->fill.fillRule = SvgFillRule::Winding;
|
node->style->fill.fillRule = FillRule::Winding;
|
||||||
|
|
||||||
//Default stroke is none
|
//Default stroke is none
|
||||||
node->style->stroke.paint.none = true;
|
node->style->stroke.paint.none = true;
|
||||||
|
|
|
@ -91,12 +91,6 @@ enum class SvgGradientType
|
||||||
Radial
|
Radial
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class SvgFillRule
|
|
||||||
{
|
|
||||||
Winding = 0,
|
|
||||||
OddEven = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
//Length type to recalculate %, pt, pc, mm, cm etc
|
//Length type to recalculate %, pt, pc, mm, cm etc
|
||||||
enum class SvgParserLengthType
|
enum class SvgParserLengthType
|
||||||
{
|
{
|
||||||
|
@ -238,7 +232,7 @@ struct SvgStyleFill
|
||||||
SvgFillFlags flags;
|
SvgFillFlags flags;
|
||||||
SvgPaint paint;
|
SvgPaint paint;
|
||||||
int opacity;
|
int opacity;
|
||||||
SvgFillRule fillRule;
|
FillRule fillRule;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SvgStyleStroke
|
struct SvgStyleStroke
|
||||||
|
|
Loading…
Add table
Reference in a new issue