From eb9b111b9395e0766e770f1a7effd77e73f43a80 Mon Sep 17 00:00:00 2001 From: cfillion Date: Fri, 18 Oct 2024 13:24:13 -0400 Subject: [PATCH] repair BR_GetMouseCursorContext over envelopes lanes set to "Project default behavior outside of automation items" Fixes #1908, regression from 9916097cc06d99071b351fa6ab544643781e6072 --- Breeder/BR_MouseUtil.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Breeder/BR_MouseUtil.cpp b/Breeder/BR_MouseUtil.cpp index 4d109ed61..7052d9420 100644 --- a/Breeder/BR_MouseUtil.cpp +++ b/Breeder/BR_MouseUtil.cpp @@ -624,9 +624,9 @@ void BR_MouseInfo::GetContext (const POINT& p) // if env is hit, check if underlying envelope outside of automation items is bypassed, #1727 if (trackEnvHit) { - int bypassUnderlEnvProjDefault = *ConfigVar("pooledenvattach") & 4; - int AIoptions = envelope.GetAIoptions(); // -1 == use project default - if ((bypassUnderlEnvProjDefault && AIoptions == -1) || (AIoptions & 4)) + const int projAiOptions = *ConfigVar("pooledenvattach"); + const int aiOptions = envelope.GetAIoptions(); // -1 == use project default + if ((aiOptions < 0 ? projAiOptions : aiOptions) & 4) { if (!this->IsMouseOverAI(envelope, height - 2 * ENV_GAP, offset + ENV_GAP, mouseY, mousePos)) trackEnvHit = 0; @@ -681,15 +681,13 @@ void BR_MouseInfo::GetContext (const POINT& p) else if (trackEnvHit == 2) mouseInfo.details = "env_segment"; // if env is hit, check if underlying envelope outside of automation items is bypassed, #1488 - int bypassUnderlEnvProjDefault = *ConfigVar("pooledenvattach") & 4; BR_Envelope envelope(mouseInfo.envelope); - int AIoptions = envelope.GetAIoptions(); // -1 == use project default - if ((bypassUnderlEnvProjDefault && AIoptions == -1) || (AIoptions & 4)) + const int projAiOptions = *ConfigVar("pooledenvattach"); + const int aiOptions = envelope.GetAIoptions(); // -1 == use project default + if ((aiOptions < 0 ? projAiOptions : aiOptions) & 4) { if (!this->IsMouseOverAI(envelope, height - 2 * ENV_GAP, offset + ENV_GAP, mouseY, mousePos)) - { mouseInfo.details = "empty"; - } } } // Item and things inside it