Merge pull request #7075 from Marmare314/issue-7053

clamp value-range for color envelopes in popups
This commit is contained in:
Robert Müller 2023-08-26 18:14:06 +00:00 committed by GitHub
commit 8effc201bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;