mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
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:
parent
4be92b227f
commit
6895cdc343
|
@ -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)
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue