memononen / nanovg

Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.
zlib License
5.07k stars 767 forks source link

Filled vector graphics is acting weird #536

Closed SNSTRUTHERS closed 5 years ago

SNSTRUTHERS commented 5 years ago

I'm trying to draw SVG data using NanoVG and some weird stuff is happening. The stroking is okay but the fill...not so much:

image

Here are the points I'm using to draw it (imported from font file); P0 & P1 are start/end points, C0 & C1 are control points for the two points for when a bezier curve is drawn. Ignore the last number; that's something else.

image

And here is the rendering code: image

Note that I tried to set the line-to case to just a normal nvgLineTo, and it produces the same effect.

SNSTRUTHERS commented 5 years ago

Nevermind. I fixed it by moving "nvgMoveTo" out of the points loop. DUH