mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #7075 from Marmare314/issue-7053
clamp value-range for color envelopes in popups
This commit is contained in:
commit
8effc201bd
|
@ -1369,7 +1369,10 @@ CUI::EPopupMenuFunctionResult CEditor::PopupEnvPoint(void *pContext, CUIRect Vie
|
|||
{
|
||||
auto [SelectedIndex, SelectedChannel] = pEditor->m_vSelectedEnvelopePoints.front();
|
||||
|
||||
if(pEnvelope->GetChannels() == 4)
|
||||
CurrentValue = clamp(CurrentValue, 0.0f, 1.0f);
|
||||
pEnvelope->m_vPoints[SelectedIndex].m_aValues[SelectedChannel] = f2fx(CurrentValue);
|
||||
|
||||
if(SelectedIndex != 0)
|
||||
{
|
||||
pEnvelope->m_vPoints[SelectedIndex].m_Time = CurrentTime * 1000.0f;
|
||||
|
|
Loading…
Reference in a new issue