From 47176e85d625681c769de1313b10a13f1fc0689c Mon Sep 17 00:00:00 2001 From: MilkeeyCat Date: Wed, 13 Nov 2024 22:14:40 +0200 Subject: [PATCH] Fix envelope point popup --- src/game/editor/popups.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index d293e851d..9ab447240 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -1439,20 +1439,20 @@ CUi::EPopupMenuFunctionResult CEditor::PopupEnvPoint(void *pContext, CUIRect Vie { auto [SelectedIndex, SelectedChannel] = pEditor->m_SelectedTangentInPoint; - pEditor->m_EnvelopeEditorHistory.Execute(std::make_shared(pEditor, pEditor->m_SelectedEnvelope, SelectedIndex, SelectedChannel, CEditorActionEditEnvelopePointValue::EType::TANGENT_IN, static_cast(OldTime * 1000.0f), f2fx(OldValue), static_cast(CurrentTime * 1000.0f), f2fx(CurrentValue))); + pEditor->m_EnvelopeEditorHistory.Execute(std::make_shared(pEditor, pEditor->m_SelectedEnvelope, SelectedIndex, SelectedChannel, CEditorActionEditEnvelopePointValue::EType::TANGENT_IN, OldTime, OldValue, static_cast(CurrentTime * 1000.0f), f2fx(CurrentValue))); CurrentTime = (pEnvelope->m_vPoints[SelectedIndex].m_Time + pEnvelope->m_vPoints[SelectedIndex].m_Bezier.m_aInTangentDeltaX[SelectedChannel]) / 1000.0f; } else if(pEditor->IsTangentOutSelected()) { auto [SelectedIndex, SelectedChannel] = pEditor->m_SelectedTangentOutPoint; - pEditor->m_EnvelopeEditorHistory.Execute(std::make_shared(pEditor, pEditor->m_SelectedEnvelope, SelectedIndex, SelectedChannel, CEditorActionEditEnvelopePointValue::EType::TANGENT_OUT, static_cast(OldTime * 1000.0f), f2fx(OldValue), static_cast(CurrentTime * 1000.0f), f2fx(CurrentValue))); + pEditor->m_EnvelopeEditorHistory.Execute(std::make_shared(pEditor, pEditor->m_SelectedEnvelope, SelectedIndex, SelectedChannel, CEditorActionEditEnvelopePointValue::EType::TANGENT_OUT, OldTime, OldValue, static_cast(CurrentTime * 1000.0f), f2fx(CurrentValue))); CurrentTime = (pEnvelope->m_vPoints[SelectedIndex].m_Time + pEnvelope->m_vPoints[SelectedIndex].m_Bezier.m_aOutTangentDeltaX[SelectedChannel]) / 1000.0f; } else { auto [SelectedIndex, SelectedChannel] = pEditor->m_vSelectedEnvelopePoints.front(); - pEditor->m_EnvelopeEditorHistory.Execute(std::make_shared(pEditor, pEditor->m_SelectedEnvelope, SelectedIndex, SelectedChannel, CEditorActionEditEnvelopePointValue::EType::POINT, static_cast(OldTime * 1000.0f), f2fx(OldValue), static_cast(CurrentTime * 1000.0f), f2fx(CurrentValue))); + pEditor->m_EnvelopeEditorHistory.Execute(std::make_shared(pEditor, pEditor->m_SelectedEnvelope, SelectedIndex, SelectedChannel, CEditorActionEditEnvelopePointValue::EType::POINT, OldTime, OldValue, static_cast(CurrentTime * 1000.0f), f2fx(CurrentValue))); if(SelectedIndex != 0) {