From fcbc77bcdf40ed6bf86d2bd808ce036eb4c10707 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Wed, 30 Jun 2021 14:16:27 +0900 Subject: [PATCH] svg_loader: code refactoring unify to tvg fill rule. --- src/loaders/svg/tvgSvgLoader.cpp | 8 ++++---- src/loaders/svg/tvgSvgLoaderCommon.h | 8 +------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/loaders/svg/tvgSvgLoader.cpp b/src/loaders/svg/tvgSvgLoader.cpp index a7e173c6..cb1262c2 100644 --- a/src/loaders/svg/tvgSvgLoader.cpp +++ b/src/loaders/svg/tvgSvgLoader.cpp @@ -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; diff --git a/src/loaders/svg/tvgSvgLoaderCommon.h b/src/loaders/svg/tvgSvgLoaderCommon.h index ba0516a2..61b04b02 100644 --- a/src/loaders/svg/tvgSvgLoaderCommon.h +++ b/src/loaders/svg/tvgSvgLoaderCommon.h @@ -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