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.
This commit is contained in:
Electric Keet 2023-08-22 14:23:32 -07:00
parent 4a9bf44b56
commit ab76546f7a
1 changed files with 4 additions and 0 deletions

View File

@ -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]<i.min ? i.min : (i.macro->val[0]>i.max ? i.max : i.macro->val[0])); \
i.macro->val[1]=(i.macro->val[1]<i.min ? i.min : (i.macro->val[1]>i.max ? i.max : i.macro->val[1])); \
} \