diff --git a/inc/thorvg.h b/inc/thorvg.h index 0c5ad62b..086c8377 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -980,11 +980,11 @@ public: * @param[in] r The red color channel value in the range [0 ~ 255]. The default value is 0. * @param[in] g The green color channel value in the range [0 ~ 255]. The default value is 0. * @param[in] b The blue color channel value in the range [0 ~ 255]. The default value is 0. - * @param[in] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. The default value is 0. + * @param[in] a The alpha channel value in the range [0 ~ 255], where 0 is completely transparent and 255 is opaque. * * @return Result::Success when succeed, Result::FailedAllocation otherwise. */ - Result stroke(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255) noexcept; + Result stroke(uint8_t r, uint8_t g, uint8_t b, uint8_t a) noexcept; /** * @brief Sets the gradient fill of the stroke for all of the figures from the path. @@ -1157,7 +1157,7 @@ public: * * @return Result::Success when succeed, Result::InsufficientCondition otherwise. */ - Result strokeColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a = nullptr) const noexcept; + Result strokeColor(uint8_t* r, uint8_t* g, uint8_t* b, uint8_t* a) const noexcept; /** * @brief Gets the pointer to the gradient fill of the stroke. diff --git a/src/examples/AnimateMasking.cpp b/src/examples/AnimateMasking.cpp index 840e7baa..62fd1970 100644 --- a/src/examples/AnimateMasking.cpp +++ b/src/examples/AnimateMasking.cpp @@ -55,7 +55,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) pMaskShape = maskShape.get(); maskShape->appendCircle(180, 180, 75, 75); maskShape->fill(125, 125, 125); - maskShape->stroke(25, 25, 25); + maskShape->stroke(25, 25, 25, 255); maskShape->stroke(tvg::StrokeJoin::Round); maskShape->stroke(10); canvas->push(std::move(maskShape)); diff --git a/src/examples/Arc.cpp b/src/examples/Arc.cpp index 533410e2..307328de 100644 --- a/src/examples/Arc.cpp +++ b/src/examples/Arc.cpp @@ -33,38 +33,38 @@ void tvgDrawCmds(tvg::Canvas* canvas) //Arc Line auto shape1 = tvg::Shape::gen(); shape1->appendArc(150, 150, 80, 10, 180, false); - shape1->stroke(255, 255, 255); + shape1->stroke(255, 255, 255, 255); shape1->stroke(2); if (canvas->push(std::move(shape1)) != tvg::Result::Success) return; auto shape2 = tvg::Shape::gen(); shape2->appendArc(400, 150, 80, 0, 300, false); - shape2->stroke(255, 255, 255); + shape2->stroke(255, 255, 255, 255); shape2->stroke(2); if (canvas->push(std::move(shape2)) != tvg::Result::Success) return; auto shape3 = tvg::Shape::gen(); shape3->appendArc(600, 150, 80, 300, 60, false); - shape3->stroke(255, 255, 255); + shape3->stroke(255, 255, 255, 255); shape3->stroke(2); if (canvas->push(std::move(shape3)) != tvg::Result::Success) return; //Pie Line auto shape4 = tvg::Shape::gen(); shape4->appendArc(150, 400, 80, 10, 180, true); - shape4->stroke(255, 255, 255); + shape4->stroke(255, 255, 255, 255); shape4->stroke(2); if (canvas->push(std::move(shape4)) != tvg::Result::Success) return; auto shape5 = tvg::Shape::gen(); shape5->appendArc(400, 400, 80, 0, 300, true); - shape5->stroke(255, 255, 255); + shape5->stroke(255, 255, 255, 255); shape5->stroke(2); if (canvas->push(std::move(shape5)) != tvg::Result::Success) return; auto shape6 = tvg::Shape::gen(); shape6->appendArc(600, 400, 80, 300, 60, true); - shape6->stroke(255, 255, 255); + shape6->stroke(255, 255, 255, 255); shape6->stroke(2); if (canvas->push(std::move(shape6)) != tvg::Result::Success) return; @@ -72,21 +72,21 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto shape7 = tvg::Shape::gen(); shape7->appendArc(150, 650, 80, 10, 180, true); shape7->fill(255, 255, 255); - shape7->stroke(255, 0, 0); + shape7->stroke(255, 0, 0, 255); shape7->stroke(2); if (canvas->push(std::move(shape7)) != tvg::Result::Success) return; auto shape8 = tvg::Shape::gen(); shape8->appendArc(400, 650, 80, 0, 300, true); shape8->fill(255, 255, 255); - shape8->stroke(255, 0, 0); + shape8->stroke(255, 0, 0, 255); shape8->stroke(2); if (canvas->push(std::move(shape8)) != tvg::Result::Success) return; auto shape9 = tvg::Shape::gen(); shape9->appendArc(600, 650, 80, 300, 60, true); shape9->fill(255, 255, 255); - shape9->stroke(255, 0, 0); + shape9->stroke(255, 0, 0, 255); shape9->stroke(2); if (canvas->push(std::move(shape9)) != tvg::Result::Success) return; } diff --git a/src/examples/ClipPath.cpp b/src/examples/ClipPath.cpp index 2c5b5a90..1ead877e 100644 --- a/src/examples/ClipPath.cpp +++ b/src/examples/ClipPath.cpp @@ -56,7 +56,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto star1 = tvg::Shape::gen(); tvgDrawStar(star1.get()); star1->fill(255, 255, 0); - star1->stroke(255 ,0, 0); + star1->stroke(255 ,0, 0, 255); star1->stroke(10); //Move Star1 @@ -72,7 +72,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto star2 = tvg::Shape::gen(); tvgDrawStar(star2.get()); star2->fill(0, 255, 255); - star2->stroke(0 ,255, 0); + star2->stroke(0 ,255, 0, 255); star2->stroke(10); star2->opacity(100); @@ -105,7 +105,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) fill->colorStops(colorStops, 2); star3->fill(std::move(fill)); - star3->stroke(255 ,0, 0); + star3->stroke(255 ,0, 0, 255); star3->stroke(10); star3->translate(400, 0); diff --git a/src/examples/CustomTransform.cpp b/src/examples/CustomTransform.cpp index 700d8703..d0f1a730 100644 --- a/src/examples/CustomTransform.cpp +++ b/src/examples/CustomTransform.cpp @@ -48,7 +48,7 @@ void tvgUpdateCmds(tvg::Canvas* canvas, float progress) shape->close(); shape->fill(0, 0, 255); shape->stroke(3); - shape->stroke(255, 255, 255); + shape->stroke(255, 255, 255, 255); //Transform Matrix tvg::Matrix m = {1, 0, 0, 0, 1, 0, 0, 0, 1}; diff --git a/src/examples/DirectUpdate.cpp b/src/examples/DirectUpdate.cpp index 56060038..f7d523ed 100644 --- a/src/examples/DirectUpdate.cpp +++ b/src/examples/DirectUpdate.cpp @@ -51,7 +51,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) //fill property will be retained shape->fill(127, 255, 255); - shape->stroke(0, 0, 255); + shape->stroke(0, 0, 255, 255); shape->stroke(1); if (canvas->push(std::move(shape)) != tvg::Result::Success) return; @@ -68,7 +68,7 @@ void tvgUpdateCmds(tvg::Canvas* canvas, float progress) if (pShape->reset() == tvg::Result::Success) { pShape->appendRect(-100 + (800 * progress), -100 + (800 * progress), 200, 200, (100 * progress), (100 * progress)); pShape->fill(127, 255, 255); - pShape->stroke(0, 0, 255); + pShape->stroke(0, 0, 255, 255); pShape->stroke(30 * progress); //Update shape for drawing (this may work asynchronously) diff --git a/src/examples/Duplicate.cpp b/src/examples/Duplicate.cpp index 696e2d7e..e4223b59 100644 --- a/src/examples/Duplicate.cpp +++ b/src/examples/Duplicate.cpp @@ -39,7 +39,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape1->appendRect(220, 10, 100, 100); shape1->stroke(3); - shape1->stroke(0, 255, 0); + shape1->stroke(0, 255, 0, 255); float dashPattern[2] = {4, 4}; shape1->stroke(dashPattern, 2); diff --git a/src/examples/GradientStroke.cpp b/src/examples/GradientStroke.cpp index c7d9d239..ef0c8a04 100644 --- a/src/examples/GradientStroke.cpp +++ b/src/examples/GradientStroke.cpp @@ -60,7 +60,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape1->lineTo(100, 150); shape1->close(); - shape1->stroke(0, 255, 0); + shape1->stroke(0, 255, 0, 255); shape1->stroke(20); shape1->stroke(tvg::StrokeJoin::Miter); shape1->stroke(tvg::StrokeCap::Butt); diff --git a/src/examples/InvLumaMasking.cpp b/src/examples/InvLumaMasking.cpp index 6ff26f97..c0b004f8 100644 --- a/src/examples/InvLumaMasking.cpp +++ b/src/examples/InvLumaMasking.cpp @@ -80,7 +80,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) star->lineTo(546, 143); star->close(); star->stroke(10); - star->stroke(255, 255, 255); + star->stroke(255, 255, 255, 255); //Mask3 auto mask3 = tvg::Shape::gen(); diff --git a/src/examples/InvMasking.cpp b/src/examples/InvMasking.cpp index a7c1f7f9..d904034d 100644 --- a/src/examples/InvMasking.cpp +++ b/src/examples/InvMasking.cpp @@ -80,7 +80,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) star->lineTo(546, 143); star->close(); star->stroke(10); - star->stroke(255, 255, 255); + star->stroke(255, 255, 255, 255); //Mask3 auto mask3 = tvg::Shape::gen(); diff --git a/src/examples/LumaMasking.cpp b/src/examples/LumaMasking.cpp index 406ff1d1..24961ae7 100644 --- a/src/examples/LumaMasking.cpp +++ b/src/examples/LumaMasking.cpp @@ -80,7 +80,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) star->lineTo(546, 143); star->close(); star->stroke(10); - star->stroke(255, 255, 255); + star->stroke(255, 255, 255, 255); //Mask3 auto mask3 = tvg::Shape::gen(); diff --git a/src/examples/Masking.cpp b/src/examples/Masking.cpp index 40daae55..289b848d 100644 --- a/src/examples/Masking.cpp +++ b/src/examples/Masking.cpp @@ -81,7 +81,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) star->close(); star->stroke(30); star->stroke(tvg::StrokeJoin::Miter); - star->stroke(255, 255, 255); + star->stroke(255, 255, 255, 255); //Mask3 auto mask3 = tvg::Shape::gen(); diff --git a/src/examples/Opacity.cpp b/src/examples/Opacity.cpp index 2c2dc286..fa88a98a 100644 --- a/src/examples/Opacity.cpp +++ b/src/examples/Opacity.cpp @@ -45,7 +45,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape2->appendRect(450, 100, 200, 200, 50, 50); shape2->fill(0, 255, 0); shape2->stroke(10); - shape2->stroke(255, 255, 255); + shape2->stroke(255, 255, 255, 255); scene->push(std::move(shape2)); @@ -74,7 +74,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape3->close(); shape3->fill(0, 0, 255); shape3->stroke(10); - shape3->stroke(255, 255, 255); + shape3->stroke(255, 255, 255, 255); shape3->opacity(127); scene2->push(std::move(shape3)); @@ -96,7 +96,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape4->close(); shape4->fill(255, 0, 0); shape4->stroke(10); - shape4->stroke(0, 0, 255); + shape4->stroke(0, 0, 255, 255); shape4->opacity(200); shape4->scale(3); scene2->push(std::move(shape4)); diff --git a/src/examples/Retaining.cpp b/src/examples/Retaining.cpp index 746e986b..f9191d87 100644 --- a/src/examples/Retaining.cpp +++ b/src/examples/Retaining.cpp @@ -55,14 +55,14 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape4->appendCircle(400, 400, 100, 100); shape4->fill(255, 0, 0); shape4->stroke(5); - shape4->stroke(255, 255, 255); + shape4->stroke(255, 255, 255, 255); scene->push(std::move(shape4)); auto shape5 = tvg::Shape::gen(); shape5->appendCircle(550, 550, 150, 150); shape5->fill(255, 0, 255); shape5->stroke(5); - shape5->stroke(255, 255, 255); + shape5->stroke(255, 255, 255, 255); scene->push(std::move(shape5)); if (canvas->push(std::move(scene)) != tvg::Result::Success) return; diff --git a/src/examples/SceneBlending.cpp b/src/examples/SceneBlending.cpp index 50734807..d40be8f2 100644 --- a/src/examples/SceneBlending.cpp +++ b/src/examples/SceneBlending.cpp @@ -51,7 +51,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape2->appendRect(450, 100, 200, 200, 50, 50); shape2->fill(0, 255, 0); shape2->stroke(10); - shape2->stroke(255, 255, 255); + shape2->stroke(255, 255, 255, 255); scene->push(std::move(shape2)); //Draw the Scene onto the Canvas @@ -80,7 +80,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape3->close(); shape3->fill(0, 0, 255); shape3->stroke(10); - shape3->stroke(255, 255, 255); + shape3->stroke(255, 255, 255, 255); shape3->opacity(127); scene2->push(std::move(shape3)); @@ -102,7 +102,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape4->close(); shape4->fill(255, 0, 0); shape4->stroke(10); - shape4->stroke(0, 0, 255); + shape4->stroke(0, 0, 255, 255); shape4->opacity(200); shape4->scale(3); scene2->push(std::move(shape4)); diff --git a/src/examples/SceneClipper.cpp b/src/examples/SceneClipper.cpp index 0dcb6c52..01cf6487 100644 --- a/src/examples/SceneClipper.cpp +++ b/src/examples/SceneClipper.cpp @@ -68,7 +68,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) //Source auto shape = tvg::Shape::gen(); shape->appendRect(100, 100, 400, 400, 50, 50); - shape->stroke(0, 0, 255); + shape->stroke(0, 0, 255, 255); shape->stroke(10); shape->fill(255, 255, 255); shape->composite(std::move(clipper), tvg::CompositeMethod::ClipPath); diff --git a/src/examples/SceneTransform.cpp b/src/examples/SceneTransform.cpp index 36199946..2b6d094c 100644 --- a/src/examples/SceneTransform.cpp +++ b/src/examples/SceneTransform.cpp @@ -40,7 +40,7 @@ void tvgUpdateCmds(tvg::Canvas* canvas, float progress) shape1->appendRect(-235, -250, 400, 400, 50, 50); //x, y, w, h, rx, ry shape1->fill(0, 255, 0); //r, g, b shape1->stroke(5); //width - shape1->stroke(255, 255, 255); //r, g, b + shape1->stroke(255, 255, 255, 255); //r, g, b, a scene->push(std::move(shape1)); //Prepare Circle (Scene1) @@ -79,7 +79,7 @@ void tvgUpdateCmds(tvg::Canvas* canvas, float progress) shape4->close(); shape4->fill(0, 0, 255, 127); shape4->stroke(3); //width - shape4->stroke(0, 0, 255); //r, g, b + shape4->stroke(0, 0, 255, 255); //r, g, b, a scene2->push(std::move(shape4)); //Circle (Scene2) diff --git a/src/examples/Stroke.cpp b/src/examples/Stroke.cpp index 7d48a1e8..4c8219ff 100644 --- a/src/examples/Stroke.cpp +++ b/src/examples/Stroke.cpp @@ -34,7 +34,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto shape1 = tvg::Shape::gen(); shape1->appendRect(50, 50, 200, 200); shape1->fill(50, 50, 50); - shape1->stroke(255, 255, 255); //color: r, g, b + shape1->stroke(255, 255, 255, 255); //color: r, g, b, a shape1->stroke(tvg::StrokeJoin::Bevel); //default is Bevel shape1->stroke(10); //width: 10px @@ -44,7 +44,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto shape2 = tvg::Shape::gen(); shape2->appendRect(300, 50, 200, 200); shape2->fill(50, 50, 50); - shape2->stroke(255, 255, 255); + shape2->stroke(255, 255, 255, 255); shape2->stroke(tvg::StrokeJoin::Round); shape2->stroke(10); @@ -54,7 +54,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto shape3 = tvg::Shape::gen(); shape3->appendRect(550, 50, 200, 200); shape3->fill(50, 50, 50); - shape3->stroke(255, 255, 255); + shape3->stroke(255, 255, 255, 255); shape3->stroke(tvg::StrokeJoin::Miter); shape3->stroke(10); @@ -64,7 +64,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto shape4 = tvg::Shape::gen(); shape4->appendCircle(150, 400, 100, 100); shape4->fill(50, 50, 50); - shape4->stroke(255, 255, 255); + shape4->stroke(255, 255, 255, 255); shape4->stroke(1); if (canvas->push(std::move(shape4)) != tvg::Result::Success) return; @@ -73,7 +73,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto shape5 = tvg::Shape::gen(); shape5->appendCircle(400, 400, 100, 100); shape5->fill(50, 50, 50); - shape5->stroke(255, 255, 255); + shape5->stroke(255, 255, 255, 255); shape5->stroke(2); if (canvas->push(std::move(shape5)) != tvg::Result::Success) return; @@ -82,7 +82,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto shape6 = tvg::Shape::gen(); shape6->appendCircle(650, 400, 100, 100); shape6->fill(50, 50, 50); - shape6->stroke(255, 255, 255); + shape6->stroke(255, 255, 255, 255); shape6->stroke(4); if (canvas->push(std::move(shape6)) != tvg::Result::Success) return; @@ -92,7 +92,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto hline = tvg::Shape::gen(); hline->moveTo(50, 550 + (25 * i)); hline->lineTo(300, 550 + (25 * i)); - hline->stroke(255, 255, 255); //color: r, g, b + hline->stroke(255, 255, 255, 255); //color: r, g, b, a hline->stroke(i + 1); //stroke width hline->stroke(tvg::StrokeCap::Round); //default is Square if (canvas->push(std::move(hline)) != tvg::Result::Success) return; @@ -100,7 +100,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto vline = tvg::Shape::gen(); vline->moveTo(500 + (25 * i), 550); vline->lineTo(500 + (25 * i), 780); - vline->stroke(255, 255, 255); //color: r, g, b + vline->stroke(255, 255, 255, 255); //color: r, g, b, a vline->stroke(i + 1); //stroke width vline->stroke(tvg::StrokeCap::Round); //default is Square if (canvas->push(std::move(vline)) != tvg::Result::Success) return; @@ -110,7 +110,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto line1 = tvg::Shape::gen(); line1->moveTo(360, 580); line1->lineTo(450, 580); - line1->stroke(255, 255, 255); //color: r, g, b + line1->stroke(255, 255, 255, 255); //color: r, g, b, a line1->stroke(15); line1->stroke(tvg::StrokeCap::Round); diff --git a/src/examples/StrokeLine.cpp b/src/examples/StrokeLine.cpp index 4515bb1e..1048c81c 100644 --- a/src/examples/StrokeLine.cpp +++ b/src/examples/StrokeLine.cpp @@ -37,7 +37,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape1->lineTo(220, 200); shape1->lineTo( 70, 170); shape1->lineTo( 70, 30); - shape1->stroke(255, 0, 0); + shape1->stroke(255, 0, 0, 255); shape1->stroke(10); shape1->stroke(tvg::StrokeJoin::Round); shape1->stroke(tvg::StrokeCap::Round); @@ -49,7 +49,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape2->lineTo(470, 200); shape2->lineTo(320, 170); shape2->lineTo(320, 30); - shape2->stroke(255, 255, 0); + shape2->stroke(255, 255, 0, 255); shape2->stroke(10); shape2->stroke(tvg::StrokeJoin::Bevel); shape2->stroke(tvg::StrokeCap::Square); @@ -61,7 +61,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape3->lineTo(720, 200); shape3->lineTo(570, 170); shape3->lineTo(570, 30); - shape3->stroke(0, 255, 0); + shape3->stroke(0, 255, 0, 255); shape3->stroke(10); shape3->stroke(tvg::StrokeJoin::Miter); shape3->stroke(tvg::StrokeCap::Butt); @@ -74,7 +74,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape4->lineTo(220, 380); shape4->lineTo( 70, 330); shape4->lineTo( 70, 210); - shape4->stroke(255, 0, 0); + shape4->stroke(255, 0, 0, 255); shape4->stroke(5); shape4->stroke(tvg::StrokeJoin::Round); shape4->stroke(tvg::StrokeCap::Round); @@ -89,7 +89,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape5->lineTo(470, 380); shape5->lineTo(320, 330); shape5->lineTo(320, 210); - shape5->stroke(255, 255, 0); + shape5->stroke(255, 255, 0, 255); shape5->stroke(5); shape5->stroke(tvg::StrokeJoin::Bevel); shape5->stroke(tvg::StrokeCap::Square); @@ -104,7 +104,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape6->lineTo(720, 380); shape6->lineTo(570, 330); shape6->lineTo(570, 210); - shape6->stroke(0, 255, 0); + shape6->stroke(0, 255, 0, 255); shape6->stroke(5); shape6->stroke(tvg::StrokeJoin::Miter); shape6->stroke(tvg::StrokeCap::Butt); @@ -116,7 +116,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) //For a comparison with shapes 10-12 auto shape7 = tvg::Shape::gen(); shape7->appendArc(70, 400, 160, 10, 70, true); - shape7->stroke(255, 0, 0); + shape7->stroke(255, 0, 0, 255); shape7->stroke(7); shape7->stroke(tvg::StrokeJoin::Round); shape7->stroke(tvg::StrokeCap::Round); @@ -124,7 +124,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto shape8 = tvg::Shape::gen(); shape8->appendArc(320, 400, 160, 10, 70, false); - shape8->stroke(255, 255, 0); + shape8->stroke(255, 255, 0, 255); shape8->stroke(7); shape8->stroke(tvg::StrokeJoin::Bevel); shape8->stroke(tvg::StrokeCap::Square); @@ -132,7 +132,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) auto shape9 = tvg::Shape::gen(); shape9->appendArc(570, 400, 160, 10, 70, true); - shape9->stroke(0, 255, 0); + shape9->stroke(0, 255, 0, 255); shape9->stroke(7); shape9->stroke(tvg::StrokeJoin::Miter); shape9->stroke(tvg::StrokeCap::Butt); @@ -143,7 +143,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape10->appendArc(70, 600, 160, 10, 30, true); shape10->appendCircle(70, 700, 20, 60); shape10->appendRect(130, 710, 100, 40); - shape10->stroke(255, 0, 0); + shape10->stroke(255, 0, 0, 255); shape10->stroke(5); shape10->stroke(tvg::StrokeJoin::Round); shape10->stroke(tvg::StrokeCap::Round); @@ -154,7 +154,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape11->appendArc(320, 600, 160, 10, 30, false); shape11->appendCircle(320, 700, 20, 60); shape11->appendRect(380, 710, 100, 40); - shape11->stroke(255, 255, 0); + shape11->stroke(255, 255, 0, 255); shape11->stroke(5); shape11->stroke(tvg::StrokeJoin::Bevel); shape11->stroke(tvg::StrokeCap::Square); @@ -165,7 +165,7 @@ void tvgDrawCmds(tvg::Canvas* canvas) shape12->appendArc(570, 600, 160, 10, 30, true); shape12->appendCircle(570, 700, 20, 60); shape12->appendRect(630, 710, 100, 40); - shape12->stroke(0, 255, 0); + shape12->stroke(0, 255, 0, 255); shape12->stroke(5); shape12->stroke(tvg::StrokeJoin::Miter); shape12->stroke(tvg::StrokeCap::Butt); diff --git a/src/examples/StrokeMiterlimit.cpp b/src/examples/StrokeMiterlimit.cpp index bd0123f8..77b6bc5e 100644 --- a/src/examples/StrokeMiterlimit.cpp +++ b/src/examples/StrokeMiterlimit.cpp @@ -53,9 +53,9 @@ void goWild(tvg::Canvas* canvas) path->lineTo(460, top / 2); path->close(); - path->fill(150, 150, 255); // fill color - path->stroke(20); // stroke width - path->stroke(120, 120, 255); // stroke color + path->fill(150, 150, 255); // fill color + path->stroke(20); // stroke width + path->stroke(120, 120, 255, 255); // stroke color // path->stroke(tvg::StrokeJoin::Round); // path->stroke(tvg::StrokeJoin::Bevel); diff --git a/src/loaders/svg/tvgSvgSceneBuilder.cpp b/src/loaders/svg/tvgSvgSceneBuilder.cpp index 89c2c868..076b3fa4 100644 --- a/src/loaders/svg/tvgSvgSceneBuilder.cpp +++ b/src/loaders/svg/tvgSvgSceneBuilder.cpp @@ -789,7 +789,7 @@ static unique_ptr _sceneBuildHelper(SvgLoaderData& loaderData, const SvgN uint8_t r, g, b; shape->fillColor(&r, &g, &b); if (shape->fill() || r < 255 || g < 255 || b < 255 || shape->strokeFill() || - (shape->strokeColor(&r, &g, &b) == Result::Success && (r < 255 || g < 255 || b < 255))) { + (shape->strokeColor(&r, &g, &b, nullptr) == Result::Success && (r < 255 || g < 255 || b < 255))) { *isMaskWhite = false; } }