memononen / nanovg

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

Line Styles (dashed, dotted, and glow) #641

Open rgb2hsv opened 2 years ago

rgb2hsv commented 2 years ago

This PR adds different line styles by generating uv textures along stroke paths and then applying a shading style. Extra vertices are inserted so that the UV distortion occurs only at the joint between line segments. There should be no distortion along straight paths, which is preferred for a rectangular selection tool.
dump

rgb2hsv commented 7 months ago

Added fixes for gles and addressed bug where line UVs get reverse when winding order is enforced.