mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
example stroke: added vertical line samples.
This commit is contained in:
parent
282b9288ab
commit
c510ced623
1 changed files with 15 additions and 7 deletions
|
@ -89,13 +89,21 @@ void tvgDrawCmds(tvg::Canvas* canvas)
|
||||||
|
|
||||||
//Test for Stroke Width
|
//Test for Stroke Width
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
auto shape = tvg::Shape::gen();
|
auto hline = tvg::Shape::gen();
|
||||||
shape->moveTo(50, 550 + (25 * i));
|
hline->moveTo(50, 550 + (25 * i));
|
||||||
shape->lineTo(750, 550 + (25 * i));
|
hline->lineTo(400, 550 + (25 * i));
|
||||||
shape->stroke(255, 255, 255, 255); //color: r, g, b, a
|
hline->stroke(255, 255, 255, 255); //color: r, g, b, a
|
||||||
shape->stroke(i + 1); //stroke width
|
hline->stroke(i + 1); //stroke width
|
||||||
shape->stroke(tvg::StrokeCap::Round); //default is Square
|
hline->stroke(tvg::StrokeCap::Round); //default is Square
|
||||||
if (canvas->push(move(shape)) != tvg::Result::Success) return;
|
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->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(move(vline)) != tvg::Result::Success) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue