Browse Source

VCA-1: When display segments have 0% height, graphics glitches are displayed on other modules. Fix by not calling nvgFill() if no rects are drawn.

tags/v2.4.0
Andrew Belt 1 year ago
parent
commit
76b049533c
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/VCA-1.cpp

+ 6
- 1
src/VCA-1.cpp View File

@@ -92,9 +92,11 @@ struct VCA_1VUKnob : SliderKnob {

// Segment gain
nvgBeginPath(args.vg);
bool segmentFill = false;
for (int c = 0; c < channels; c++) {
float gain = module ? module->lastGains[c] : 1.f;
if (gain >= 0.005f) {
segmentFill = true;
nvgRect(args.vg,
r.pos.x + r.size.x * c / channels,
r.pos.y + r.size.y * (1 - gain),
@@ -103,7 +105,10 @@ struct VCA_1VUKnob : SliderKnob {
}
}
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
const int segs = 25;


Loading…
Cancel
Save