Merge pull request #6993 from Marmare314/hidden-channel-bug

Ignore hidden channels when selecting envelopes
This commit is contained in:
Dennis Felsing 2023-08-10 20:22:07 +00:00 committed by GitHub
commit 7f636329b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -5944,7 +5944,7 @@ private:
}
};
void CEditor::SetHotEnvelopePoint(const CUIRect &View, const std::shared_ptr<CEnvelope> &pEnvelope)
void CEditor::SetHotEnvelopePoint(const CUIRect &View, const std::shared_ptr<CEnvelope> &pEnvelope, int ActiveChannels)
{
if(!UI()->MouseInside(&View))
return;
@ -5971,6 +5971,9 @@ void CEditor::SetHotEnvelopePoint(const CUIRect &View, const std::shared_ptr<CEn
{
for(int c = 0; c < pEnvelope->GetChannels(); c++)
{
if(!(ActiveChannels & (1 << c)))
continue;
if(i > 0 && pEnvelope->m_vPoints[i - 1].m_Curvetype == CURVETYPE_BEZIER)
{
float px = EnvelopeToScreenX(View, fxt2f(pEnvelope->m_vPoints[i].m_Time + pEnvelope->m_vPoints[i].m_Bezier.m_aInTangentDeltaX[c]));
@ -6593,7 +6596,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
{
if(s_Operation == OP_NONE)
SetHotEnvelopePoint(View, pEnvelope);
SetHotEnvelopePoint(View, pEnvelope, s_ActiveChannels);
UI()->ClipEnable(&View);
Graphics()->TextureClear();

View file

@ -1444,7 +1444,7 @@ public:
void RenderExtraEditorDragBar(CUIRect View, CUIRect DragBar);
void SetHotEnvelopePoint(const CUIRect &View, const std::shared_ptr<CEnvelope> &pEnvelope);
void SetHotEnvelopePoint(const CUIRect &View, const std::shared_ptr<CEnvelope> &pEnvelope, int ActiveChannels);
void RenderMenubar(CUIRect Menubar);
void RenderFileDialog();