瀏覽代碼

Support for SVG fill-rule

Chlumsky 1 年之前
父節點
當前提交
f04dc6acd3
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      ext/import-svg.cpp

+ 3 - 0
ext/import-svg.cpp

@@ -519,6 +519,9 @@ static void gatherPaths(SkPath &fullPath, int &flags, tinyxml2::XMLElement *pare
                 curPath.close();
             } else
                 continue;
+            const char *fillRule = cur->Attribute("fill-rule");
+            if (fillRule && !strcmp(fillRule, "evenodd"))
+                curPath.setFillType(SkPathFillType::kEvenOdd);
             curPath.transform(combineTransformation(flags, transformation, cur->Attribute("transform"), cur->Attribute("transform-origin")));
             if (Op(fullPath, curPath, kUnion_SkPathOp, &fullPath))
                 flags |= SVG_IMPORT_SUCCESS_FLAG;