From 0ecf2af3a35f4a66d394bbf434023d32450b1eba Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 8 Nov 2021 10:07:42 +0000 Subject: [PATCH] Fix VCA-1 out of bounds fill Signed-off-by: falkTX --- src/VCA-1.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/VCA-1.cpp b/src/VCA-1.cpp index 28b0884..feaaeb2 100644 --- a/src/VCA-1.cpp +++ b/src/VCA-1.cpp @@ -91,32 +91,32 @@ struct VCA_1VUKnob : SliderKnob { } // Segment gain - nvgBeginPath(args.vg); for (int c = 0; c < channels; c++) { float gain = module ? module->lastGains[c] : 1.f; if (gain >= 0.005f) { + nvgBeginPath(args.vg); nvgRect(args.vg, r.pos.x + r.size.x * c / channels, r.pos.y + r.size.y * (1 - gain), r.size.x / channels, r.size.y * gain); + nvgFillColor(args.vg, SCHEME_YELLOW); + nvgFill(args.vg); } } - nvgFillColor(args.vg, SCHEME_YELLOW); - nvgFill(args.vg); // Invisible separators const int segs = 25; - nvgBeginPath(args.vg); + nvgFillColor(args.vg, bgColor); for (int i = 1; i < segs; i++) { + nvgBeginPath(args.vg); nvgRect(args.vg, r.pos.x - 1.0, r.pos.y + r.size.y * i / segs, r.size.x + 2.0, 1.0); + nvgFill(args.vg); } - nvgFillColor(args.vg, bgColor); - nvgFill(args.vg); } };