Merge pull request #8043 from Robyt3/Editor-Envelope-Point-Color-Fix

Fix editor crash when right-clicking bezier control points
This commit is contained in:
Dennis Felsing 2024-03-02 12:50:42 +00:00 committed by GitHub
commit 5d070ec5c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -6748,7 +6748,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
{ {
static SPopupMenuId s_PopupEnvPointId; static SPopupMenuId s_PopupEnvPointId;
const auto &&ShowPopupEnvPoint = [&]() { 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) 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]; 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(RowHeight, &Row, &View);
View.HSplitTop(4.0f, nullptr, &View); View.HSplitTop(4.0f, nullptr, &View);