Skip to content

Commit

Permalink
fix bug in SourceSelection: don't set s to temporary values (#2313)
Browse files Browse the repository at this point in the history
- If we were on OLED, and last allowable modulation source was
  highlighted, but there were non-allowed ones after it, trying to
  scroll further would bail out with with SourceSelection::s set
  to a non-allowed value even though we had an allowed on selected.

  Solution is to set s only after we've found a legal value: in
  event of the bailout we retain the previous legal value.

- fixes #2312
  • Loading branch information
nikodemus authored Jul 20, 2024
1 parent 9c7d66a commit d2ed0b0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/deluge/gui/menu_item/source_selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,9 @@ void SourceSelection::selectEncoderAction(int32_t offset) {
newValue = ((newValue % kNumPatchSources) + kNumPatchSources) % kNumPatchSources;
}

s = sourceMenuContents[newValue];

} while (!sourceIsAllowed(s));
} while (!sourceIsAllowed(sourceMenuContents[newValue]));

s = sourceMenuContents[newValue];
this->setValue(newValue);

if (display->haveOLED()) {
Expand Down

0 comments on commit d2ed0b0

Please sign in to comment.