MIDI List editor: fix off by one with scroll duration

This commit is contained in:
Robin Gareus 2023-09-24 13:11:07 +02:00
parent 82fdd08953
commit 1386a96af0
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -302,7 +302,12 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
cmd->change (note, prop, (uint8_t) (note->velocity() + idelta));
break;
case MidiModel::NoteDiffCommand::Length:
if (note->length() + beat_delta >= Temporal::Beats::one_tick()) {
if (note->length() <= Temporal::Beats::one_tick() && beat_delta.to_ticks () > 0) {
/* Special case increments starting at 1 tick.
* Next step up after 1 is 1920 (not 1921) - or fine grained 30 (not 31).
*/
cmd->change (note, prop, beat_delta);
} else if (note->length() + beat_delta >= Temporal::Beats::one_tick()) {
cmd->change (note, prop, note->length() + beat_delta);
} else {
cmd->change (note, prop, Temporal::Beats::one_tick());