| @@ -92,9 +92,11 @@ struct VCA_1VUKnob : SliderKnob { | |||||
| // Segment gain | // Segment gain | ||||
| nvgBeginPath(args.vg); | nvgBeginPath(args.vg); | ||||
| bool segmentFill = false; | |||||
| for (int c = 0; c < channels; c++) { | for (int c = 0; c < channels; c++) { | ||||
| float gain = module ? module->lastGains[c] : 1.f; | float gain = module ? module->lastGains[c] : 1.f; | ||||
| if (gain >= 0.005f) { | if (gain >= 0.005f) { | ||||
| segmentFill = true; | |||||
| nvgRect(args.vg, | nvgRect(args.vg, | ||||
| r.pos.x + r.size.x * c / channels, | r.pos.x + r.size.x * c / channels, | ||||
| r.pos.y + r.size.y * (1 - gain), | r.pos.y + r.size.y * (1 - gain), | ||||
| @@ -103,7 +105,10 @@ struct VCA_1VUKnob : SliderKnob { | |||||
| } | } | ||||
| } | } | ||||
| nvgFillColor(args.vg, SCHEME_YELLOW); | nvgFillColor(args.vg, SCHEME_YELLOW); | ||||
| nvgFill(args.vg); | |||||
| // If nvgFill() is called with 0 path elements, it can fill other undefined paths. | |||||
| if (segmentFill) { | |||||
| nvgFill(args.vg); | |||||
| } | |||||
| // Invisible separators | // Invisible separators | ||||
| const int segs = 25; | const int segs = 25; | ||||