Fixed SVG import - Do not use fill winding nonzero when only stroking

This commit is contained in:
Jindra Petřík
2023-10-28 11:09:00 +02:00
parent 7e30e7335b
commit 2c624af18a
2 changed files with 11 additions and 7 deletions

View File

@@ -557,13 +557,16 @@ public class SvgImporter {
private void processCommands(int shapeNum, SHAPEWITHSTYLE shapes, List<PathCommand> commands, Matrix transform, SvgStyle style, boolean morphShape, boolean shape2) {
if ("nonzero".equals(style.getFillRule())) {
if (!shape2 && (shapeTag instanceof DefineShape4Tag)) {
DefineShape4Tag shape4 = (DefineShape4Tag) shapeTag;
shape4.usesFillWindingRule = true;
}
if (shape2 && (endShape instanceof DefineShape4Tag)) {
DefineShape4Tag shape4 = (DefineShape4Tag) endShape;
shape4.usesFillWindingRule = true;
SvgFill fill = style.getFill();
if (fill != null && !(fill instanceof SvgTransparentFill)) {
if (!shape2 && (shapeTag instanceof DefineShape4Tag)) {
DefineShape4Tag shape4 = (DefineShape4Tag) shapeTag;
shape4.usesFillWindingRule = true;
}
if (shape2 && (endShape instanceof DefineShape4Tag)) {
DefineShape4Tag shape4 = (DefineShape4Tag) endShape;
shape4.usesFillWindingRule = true;
}
}
}