Fix editor crash when right-clicking bezier control points

The color selection should only be shown for normal envelope points but not for bezier control points, because it always changes the previously selected normal envelope point. This caused the client to crash when right-clicking a bezier control point when no normal envelope point was previously selected.

Closes #8020.
This commit is contained in:
Robert Müller 2024-03-02 13:12:21 +01:00
parent 4be92b227f
commit 6895cdc343
2 changed files with 2 additions and 2 deletions

View file

@ -6748,7 +6748,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
{
static SPopupMenuId s_PopupEnvPointId;
const auto &&ShowPopupEnvPoint = [&]() {
UI()->DoPopupMenu(&s_PopupEnvPointId, UI()->MouseX(), UI()->MouseY(), 150, 56 + (pEnvelope->GetChannels() == 4 ? 16.0f : 0.0f), this, PopupEnvPoint);
UI()->DoPopupMenu(&s_PopupEnvPointId, UI()->MouseX(), UI()->MouseY(), 150, 56 + (pEnvelope->GetChannels() == 4 && !IsTangentSelected() ? 16.0f : 0.0f), this, PopupEnvPoint);
};
if(s_Operation == EEnvelopeEditorOp::OP_NONE)

View file

@ -1360,7 +1360,7 @@ CUI::EPopupMenuFunctionResult CEditor::PopupEnvPoint(void *pContext, CUIRect Vie
std::shared_ptr<CEnvelope> pEnvelope = pEditor->m_Map.m_vpEnvelopes[pEditor->m_SelectedEnvelope];
if(pEnvelope->GetChannels() == 4)
if(pEnvelope->GetChannels() == 4 && !pEditor->IsTangentSelected())
{
View.HSplitTop(RowHeight, &Row, &View);
View.HSplitTop(4.0f, nullptr, &View);