Browse Source

Don't display negative meter measurements.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
7bd26deefc
2 changed files with 2 additions and 1 deletions
  1. +1
    -0
      src/app/ModuleWidget.cpp
  2. +1
    -1
      src/engine/Module.cpp

+ 1
- 0
src/app/ModuleWidget.cpp View File

@@ -239,6 +239,7 @@ void ModuleWidget::draw(const DrawArgs& args) {
for (int i = 0; i < meterLength; i++) {
int index = math::eucMod(meterIndex + i + 1, meterLength);
float meter = math::clamp(meterBuffer[index] * sampleRate, 0.f, 1.f);
meter = std::max(0.f, meter);
math::Vec p;
p.x = (float) i / (meterLength - 1) * box.size.x;
p.y = (1.f - meter) * plotHeight;


+ 1
- 1
src/engine/Module.cpp View File

@@ -16,7 +16,7 @@ namespace engine {
// Arbitrary prime number so it doesn't over- or under-estimate time of buffered processors.
static const int METER_DIVIDER = 37;
static const int METER_BUFFER_LEN = 32;
static const float METER_TIME = 0.5f;
static const float METER_TIME = 1.f;


struct Module::Internal {


Loading…
Cancel
Save