correct computation of new note length after a front-drag-trim

This commit is contained in:
Paul Davis 2020-01-28 00:05:44 -07:00
parent 10978a2f58
commit fd62b38f8d

View file

@ -3165,9 +3165,9 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_
const Temporal::Beats x_beats = Temporal::Beats (e_qaf - quarter_note_start);
if (at_front && x_beats < canvas_note->note()->end_time()) {
note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::StartTime, x_beats - (sign * snap_delta_beats));
Temporal::Beats len = canvas_note->note()->time() - x_beats + (sign * snap_delta_beats);
len += canvas_note->note()->length();
const Temporal::Beats new_start = x_beats - (sign * snap_delta_beats);
note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::StartTime, new_start);
Temporal::Beats len = canvas_note->note()->end_time() - new_start;
if (!!len) {
note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::Length, len);