From bed95a64a0c2b9beb9d8d4e70e469f87da71ef58 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 22 Nov 2014 15:33:40 -0500 Subject: [PATCH] Fix note resizing. --- gtk2_ardour/midi_region_view.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index b3c2cf1f84..d134e3d2f5 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -2748,24 +2748,24 @@ MidiRegionView::commit_resizing (NoteBase* primary, bool at_front, double delta_ current_x = snap_pixel_to_sample (current_x) + _region->start (); /* and then to beats */ - current_x = region_frames_to_region_beats (current_x); + const Evoral::MusicalTime x_beats = region_frames_to_region_beats (current_x); - if (at_front && current_x < canvas_note->note()->end_time()) { - note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::StartTime, current_x); + if (at_front && x_beats < canvas_note->note()->end_time()) { + note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::StartTime, x_beats); - double len = canvas_note->note()->time() - current_x; + Evoral::MusicalTime len = canvas_note->note()->time() - x_beats; len += canvas_note->note()->length(); - if (len > 0) { + if (len) { /* XXX convert to beats */ note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::Length, len); } } if (!at_front) { - double len = current_x - canvas_note->note()->time(); + const Evoral::MusicalTime len = x_beats - canvas_note->note()->time(); - if (len > 0) { + if (len) { /* XXX convert to beats */ note_diff_add_change (canvas_note, MidiModel::NoteDiffCommand::Length, len); }