From ab76546f7a60a1c39a735b161b2c2ae95c73cd7f Mon Sep 17 00:00:00 2001 From: Electric Keet Date: Tue, 22 Aug 2023 14:23:32 -0700 Subject: [PATCH] Fixing the fix. This checks for both values being set to zero (their freshly-initialized state, which shouldn't happen in normal use) and sets them to proper defaults if so. Otherwise, it uses what was already there. --- src/gui/insEdit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index cdbbe9d12..0dcd729db 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -1767,6 +1767,10 @@ void FurnaceGUI::drawMacroEdit(FurnaceGUIMacroDesc& i, int totalFit, float avail \ /* if ADSR/LFO, populate min/max */ \ if (i.macro->open&6) { \ + if ((i.macro->val[0]==0) & (i.macro->val[1]==0)) { \ + i.macro->val[0]=i.min; \ + i.macro->val[1]=i.max; \ + } \ i.macro->val[0]=(i.macro->val[0]val[0]>i.max ? i.max : i.macro->val[0])); \ i.macro->val[1]=(i.macro->val[1]val[1]>i.max ? i.max : i.macro->val[1])); \ } \