From 7cb85d543c16928baa85e3870faeccf212ef14ef Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 19 Jun 2019 07:52:05 -0400 Subject: [PATCH] Allow ParamQuantity::displayMultiplier to be 0. --- src/engine/ParamQuantity.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/engine/ParamQuantity.cpp b/src/engine/ParamQuantity.cpp index c4950906..fd20bd06 100644 --- a/src/engine/ParamQuantity.cpp +++ b/src/engine/ParamQuantity.cpp @@ -72,7 +72,11 @@ float ParamQuantity::getDisplayValue() { void ParamQuantity::setDisplayValue(float displayValue) { if (!module) return; - float v = (displayValue - displayOffset) / displayMultiplier; + float v = displayValue - displayOffset; + if (displayMultiplier == 0.f) + v = 0.f; + else + v /= displayMultiplier; if (displayBase == 0.f) { // Linear // v is unchanged