Skip to content

Commit

Permalink
Better lead state selection management (#1358)
Browse files Browse the repository at this point in the history
Fixes #1270 properly. Makes sure the internal state for selected
lead zone is set *before* we message the server to avoid inconsistent
messages. Kepp the drag window though just to be safe.

Closes #1270
  • Loading branch information
baconpaul authored Sep 20, 2024
1 parent 6e3e482 commit 5b39119
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,23 @@ void ZoneLayoutDisplay::mouseDown(const juce::MouseEvent &e)
else if (e.mods.isAltDown())
{
// alt click promotes it to lead
display->setLeadSelection(nextZone);
display->editor->doSelectionAction(nextZone, true, false, true);
lastMousePos = e.position;
mouseState = DRAG_SELECTED_ZONE;
}
else
{
// single click makes it a single lead
display->setLeadSelection(nextZone);
display->editor->doSelectionAction(nextZone, true, true, true);
lastMousePos = e.position;
mouseState = DRAG_SELECTED_ZONE;
}
}
else
{
display->setLeadSelection(nextZone);
display->editor->doSelectionAction(
nextZone, true, !(e.mods.isCommandDown() || e.mods.isAltDown()), true);
lastMousePos = e.position;
Expand Down Expand Up @@ -280,7 +283,7 @@ void ZoneLayoutDisplay::mouseDrag(const juce::MouseEvent &e)
{
if (mouseState == DRAG_SELECTED_ZONE)
{
if (e.getDistanceFromDragStart() < 3)
if (e.getDistanceFromDragStart() < 2)
{
return;
}
Expand Down

0 comments on commit 5b39119

Please sign in to comment.