UI: Fix low value of std::clamp gets greater than high value

`std::clamp` was introduced at 60a45d3aa3 but it caused a runtime
assertion failure on Windows that checks the low value of `std::clamp`
is not greater than the high value.
This commit is contained in:
Norihiro Kamae
2024-08-29 10:40:39 +09:00
committed by Ryan Foster
parent 612ef65726
commit 06642fdee4

View File

@@ -1008,7 +1008,7 @@ VolumeMeter::calculateBallisticsForChannel(int channelNr, uint64_t ts,
float decay = float(peakDecayRate * timeSinceLastRedraw);
displayPeak[channelNr] =
std::clamp(displayPeak[channelNr] - decay,
currentPeak[channelNr], 0.f);
std::min(currentPeak[channelNr], 0.f), 0.f);
}
if (currentPeak[channelNr] >= displayPeakHold[channelNr] ||