Browse Source

Small correction to meters

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.02
falkTX 3 years ago
parent
commit
ca3ea265f0
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 22 additions and 13 deletions
  1. +10
    -4
      plugins/Cardinal/src/Ildaeil.cpp
  2. +12
    -9
      plugins/Cardinal/src/Widgets.hpp

+ 10
- 4
plugins/Cardinal/src/Ildaeil.cpp View File

@@ -1553,7 +1553,10 @@ struct IldaeilNanoMeterIn : NanoMeter {
IldaeilModule* const module;

IldaeilNanoMeterIn(IldaeilModule* const m)
: module(m) {}
: module(m)
{
withBackground = false;
}

void updateMeters() override
{
@@ -1571,7 +1574,10 @@ struct IldaeilNanoMeterOut : NanoMeter {
IldaeilModule* const module;

IldaeilNanoMeterOut(IldaeilModule* const m)
: module(m) {}
: module(m)
{
withBackground = false;
}

void updateMeters() override
{
@@ -1613,12 +1619,12 @@ struct IldaeilModuleWidget : ModuleWidgetWithSideScrews<26> {

IldaeilNanoMeterIn* const meterIn = new IldaeilNanoMeterIn(module);
meterIn->box.pos = Vec(2.0f, startY + padding * 2);
meterIn->box.size = Vec(RACK_GRID_WIDTH * 3 - 2.0f, box.size.y - meterIn->box.pos.y - 20.0f);
meterIn->box.size = Vec(RACK_GRID_WIDTH * 3 - 2.0f, box.size.y - meterIn->box.pos.y - 19.0f);
addChild(meterIn);

IldaeilNanoMeterOut* const meterOut = new IldaeilNanoMeterOut(module);
meterOut->box.pos = Vec(box.size.x - RACK_GRID_WIDTH * 3 + 1.0f, startY + padding * 2);
meterOut->box.size = Vec(RACK_GRID_WIDTH * 3 - 2.0f, box.size.y - meterOut->box.pos.y - 20.0f);
meterOut->box.size = Vec(RACK_GRID_WIDTH * 3 - 2.0f, box.size.y - meterOut->box.pos.y - 19.0f);
addChild(meterOut);
}



+ 12
- 9
plugins/Cardinal/src/Widgets.hpp View File

@@ -243,6 +243,7 @@ struct NanoKnob : Knob {

struct NanoMeter : Widget {
bool hasGainKnob = false;
bool withBackground = true;
float gainMeterL = 0.0f;
float gainMeterR = 0.0f;

@@ -255,15 +256,17 @@ struct NanoMeter : Widget {

const float usableHeight = box.size.y - (hasGainKnob ? 10.0f : 0.0f);

// draw background
nvgBeginPath(args.vg);
nvgRect(args.vg,
0,
0,
box.size.x,
usableHeight);
nvgFillColor(args.vg, nvgRGB(26, 26, 26));
nvgFill(args.vg);
if (withBackground)
{
nvgBeginPath(args.vg);
nvgRect(args.vg,
0,
0,
box.size.x,
usableHeight);
nvgFillColor(args.vg, nvgRGB(26, 26, 26));
nvgFill(args.vg);
}

nvgFillColor(args.vg, nvgRGBAf(0.76f, 0.11f, 0.22f, 0.5f));
nvgStrokeColor(args.vg, nvgRGBf(0.76f, 0.11f, 0.22f));


Loading…
Cancel
Save