mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
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:
commit
5d070ec5c3
|
@ -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