diff --git a/src/lib/sw_engine/tvgSwShape.cpp b/src/lib/sw_engine/tvgSwShape.cpp index a4c811af..4c99fb14 100644 --- a/src/lib/sw_engine/tvgSwShape.cpp +++ b/src/lib/sw_engine/tvgSwShape.cpp @@ -528,11 +528,14 @@ bool shapeGenOutline(SwShape& shape, const Shape* sdata) _growOutlinePoint(*outline, outlinePtsCnt); _growOutlineContour(*outline, outlineCntrsCnt); + auto closed = false; + //Generate Outlines while (cmdCnt-- > 0) { switch(*cmds) { case PathCommand::Close: { _outlineClose(*outline); + closed = true; break; } case PathCommand::MoveTo: { @@ -556,6 +559,8 @@ bool shapeGenOutline(SwShape& shape, const Shape* sdata) _outlineEnd(*outline); + if (closed) outline->opened = false; + //FIXME: //outline->flags = SwOutline::FillRule::Winding; diff --git a/test/testPath.cpp b/test/testPath.cpp index 3fbb8346..8c798481 100644 --- a/test/testPath.cpp +++ b/test/testPath.cpp @@ -39,6 +39,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape2->cubicTo(cx + radius, cy + halfRadius, cx + halfRadius, cy + radius, cx, cy+ radius); shape2->cubicTo(cx - halfRadius, cy + radius, cx - radius, cy + halfRadius, cx - radius, cy); shape2->cubicTo(cx - radius, cy - halfRadius, cx - halfRadius, cy - radius, cx, cy - radius); + shape2->close(); shape2->fill(255, 0, 0, 255); if (canvas->push(move(shape2)) != tvg::Result::Success) return; @@ -147,4 +148,4 @@ int main(int argc, char **argv) //Terminate ThorVG Engine tvg::Initializer::term(tvgEngine); -} \ No newline at end of file +} diff --git a/test/testSceneTransform.cpp b/test/testSceneTransform.cpp index 8c0898f6..fc088a5c 100644 --- a/test/testSceneTransform.cpp +++ b/test/testSceneTransform.cpp @@ -75,6 +75,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape5->cubicTo(cx + radius, cy + halfRadius, cx + halfRadius, cy + radius, cx, cy+ radius); shape5->cubicTo(cx - halfRadius, cy + radius, cx - radius, cy + halfRadius, cx - radius, cy); shape5->cubicTo(cx - radius, cy - halfRadius, cx - halfRadius, cy - radius, cx, cy - radius); + shape5->close(); shape5->fill(127, 0, 0, 127); scene2->push(move(shape5)); @@ -228,4 +229,4 @@ int main(int argc, char **argv) //Terminate ThorVG Engine tvg::Initializer::term(tvgEngine); -} \ No newline at end of file +}