Closed DCubix closed 1 year ago
The nvgPathWinding()
has weird API, it is not a state, but instead it sets the winding of the last path, so it should come after the nvgCircle()
.
The composite path support is somewhat limited and you may have some rendering artifacts.
I recommend to draw the shapes as two arcs, one outside and one inside, if you can.
Something along these lines (untested):
nvgBeginPath(ctx);
nvgArc(ctx, b.width / 2, b.height / 2, radius, angleFrom + gap * 2, angleFrom, NVG_CW); // outer
nvgArc(ctx, b.width / 2, b.height / 2, radius - thickness, angleFrom + gap * 2, angleFrom, NVG_CCW); // inner
@memononen I tested it and I just needed to flip the start and end angles on the second line like this:
nvgBeginPath(ctx);
nvgArc(ctx, b.width / 2, b.height / 2, radius, angleFrom + gap * 2, angleFrom, NVG_CW);
nvgArc(ctx, b.width / 2, b.height / 2, radius - thickness, angleFrom, angleFrom + gap * 2, NVG_CCW);
And it worked :D
I'm trying to draw an Arc using NanoVG in C++ but I get the following artifact:![image](https://user-images.githubusercontent.com/5081992/210845213-4a04ef62-3c2c-4a50-9e92-af83dac37876.png)
That triangle in the middle... The desired result would be this:![image](https://user-images.githubusercontent.com/5081992/210845451-241a9ac7-39e5-479f-9340-0f1aff8720aa.png)
This is my code: