Browse Source

Fix VCA-1 out of bounds fill

Signed-off-by: falkTX <falktx@falktx.com>
pull/129/head
falkTX 3 years ago
parent
commit
0ecf2af3a3
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      src/VCA-1.cpp

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

@@ -91,32 +91,32 @@ struct VCA_1VUKnob : SliderKnob {
} }


// Segment gain // Segment gain
nvgBeginPath(args.vg);
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) {
nvgBeginPath(args.vg);
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),
r.size.x / channels, r.size.x / channels,
r.size.y * gain); r.size.y * gain);
nvgFillColor(args.vg, SCHEME_YELLOW);
nvgFill(args.vg);
} }
} }
nvgFillColor(args.vg, SCHEME_YELLOW);
nvgFill(args.vg);


// Invisible separators // Invisible separators
const int segs = 25; const int segs = 25;
nvgBeginPath(args.vg);
nvgFillColor(args.vg, bgColor);
for (int i = 1; i < segs; i++) { for (int i = 1; i < segs; i++) {
nvgBeginPath(args.vg);
nvgRect(args.vg, nvgRect(args.vg,
r.pos.x - 1.0, r.pos.x - 1.0,
r.pos.y + r.size.y * i / segs, r.pos.y + r.size.y * i / segs,
r.size.x + 2.0, r.size.x + 2.0,
1.0); 1.0);
nvgFill(args.vg);
} }
nvgFillColor(args.vg, bgColor);
nvgFill(args.vg);
} }
}; };




Loading…
Cancel
Save