mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 22:58:44 +00:00
example stroke: updated the sample
This commit is contained in:
parent
e195ac8b30
commit
840e4f54f0
1 changed files with 5 additions and 5 deletions
|
@ -91,15 +91,15 @@ void tvgDrawCmds(tvg::Canvas* canvas)
|
|||
for (int i = 0; i < 10; ++i) {
|
||||
auto hline = tvg::Shape::gen();
|
||||
hline->moveTo(50, 550 + (25 * i));
|
||||
hline->lineTo(400, 550 + (25 * i));
|
||||
hline->lineTo(300, 550 + (25 * i));
|
||||
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(move(hline)) != tvg::Result::Success) return;
|
||||
|
||||
auto vline = tvg::Shape::gen();
|
||||
vline->moveTo(450 + (33 * i), 550);
|
||||
vline->lineTo(450 + (33 * i), 780);
|
||||
vline->moveTo(500 + (25 * i), 550);
|
||||
vline->lineTo(500 + (25 * i), 780);
|
||||
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
|
||||
|
@ -108,8 +108,8 @@ void tvgDrawCmds(tvg::Canvas* canvas)
|
|||
|
||||
//Stroke cap test
|
||||
auto line1 = tvg::Shape::gen();
|
||||
line1->moveTo(320, 580);
|
||||
line1->lineTo(490, 580);
|
||||
line1->moveTo(360, 580);
|
||||
line1->lineTo(450, 580);
|
||||
line1->stroke(255, 255, 255, 255); //color: r, g, b, a
|
||||
line1->stroke(15);
|
||||
line1->stroke(tvg::StrokeCap::Round);
|
||||
|
|
Loading…
Add table
Reference in a new issue