Skip to content

Commit

Permalink
UI: Fix low value of std::clamp gets greater than high value
Browse files Browse the repository at this point in the history
`std::clamp` was introduced at 60a45d3 but it caused a runtime
assertion failure on Windows that checks the low value of `std::clamp`
is not greater than the high value.
  • Loading branch information
norihiro authored and RytoEX committed Sep 18, 2024
1 parent 612ef65 commit 06642fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion UI/volume-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] ||
Expand Down

0 comments on commit 06642fd

Please sign in to comment.