Skip to content

Commit

Permalink
repair BR_GetMouseCursorContext over envelopes lanes set to "Project …
Browse files Browse the repository at this point in the history
…default behavior outside of automation items"

Fixes #1908, regression from 9916097
  • Loading branch information
cfillion committed Oct 18, 2024
1 parent 539b524 commit c74cfa1
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions Breeder/BR_MouseUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,13 +624,10 @@ 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<int>("pooledenvattach") & 4;
int AIoptions = envelope.GetAIoptions(); // -1 == use project default
if ((bypassUnderlEnvProjDefault && AIoptions == -1) || (AIoptions & 4))
{
if (!this->IsMouseOverAI(envelope, height - 2 * ENV_GAP, offset + ENV_GAP, mouseY, mousePos))
trackEnvHit = 0;
}
int aiOptions = envelope.GetAIoptions(); // -1 == use project default
if (aiOptions < 0) aiOptions = *ConfigVar<int>("pooledenvattach");
if (aiOptions & 4 && !this->IsMouseOverAI(envelope, height - 2 * ENV_GAP, offset + ENV_GAP, mouseY, mousePos))
trackEnvHit = 0;
}
}

Expand Down Expand Up @@ -681,16 +678,11 @@ 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<int>("pooledenvattach") & 4;
BR_Envelope envelope(mouseInfo.envelope);
int AIoptions = envelope.GetAIoptions(); // -1 == use project default
if ((bypassUnderlEnvProjDefault && AIoptions == -1) || (AIoptions & 4))
{
if (!this->IsMouseOverAI(envelope, height - 2 * ENV_GAP, offset + ENV_GAP, mouseY, mousePos))
{
mouseInfo.details = "empty";
}
}
int aiOptions = envelope.GetAIoptions(); // -1 == use project default
if (aiOptions < 0) aiOptions = *ConfigVar<int>("pooledenvattach");
if (aiOptions & 4 && !this->IsMouseOverAI(envelope, height - 2 * ENV_GAP, offset + ENV_GAP, mouseY, mousePos))
mouseInfo.details = "empty";
}
// Item and things inside it
if (!trackEnvHit && mouseInfo.item)
Expand Down

0 comments on commit c74cfa1

Please sign in to comment.