computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit bf6a2e6892747326c251d8e7898403cd2862f5a6
parent 6439e5d3355eab122694aaa6d41ec8ae89ea1303
Author: Adam <[email protected]>
Date:   Thu,  9 Apr 2020 19:06:35 -0500

add defaults
Diffstat:
Msrc/drawFunctions.hpp | 21++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/drawFunctions.hpp b/src/drawFunctions.hpp @@ -8,12 +8,24 @@ struct DrawHelper { DrawHelper(DrawArgs &someArgs) { args = someArgs; } - void drawOutline(std::vector<Vec> points,NVGColor color,float thickness) { + void drawShape(std::vector<Vec> points, NVGColor fillColor) { + + } + void drawShape(std::vector<Vec> points,NVGColor fillColor,NVGColor strokeColor) { + + } + + + void drawShape(std::vector<Vec> points,NVGColor strokeColor,float thickness) { + + } + void drawShape(std::vector<Vec> points,NVGColor fillColor,NVGColor strokeColor,float thickness) { unsigned int n = points.size(); nvgSave(args.vg); nvgBeginPath(args.vg); - nvgStrokeStyle(args.vg,color); + nvgStrokeStyle(args.vg,strokeColor); nvgStrokeWidth(args.vg,thickness); + nvgFillStyle(fillColor); nvgMoveTo(args.vg,points[0].x,points[0].y); for(int i = 1; i < n; i++) { @@ -21,7 +33,10 @@ struct DrawHelper { } nvgClosePath(args.vg); - nvgStroke(args.vg); + nvgFill(args.vg); + if(thickness > 0) { + nvgStroke(args.vg); + } nvgRestore(args.vg); } };