summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_region_view.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-22 15:33:40 -0500
committerDavid Robillard <d@drobilla.net>2014-11-22 15:33:40 -0500
commitbed95a64a0c2b9beb9d8d4e70e469f87da71ef58 (patch)
tree842f5b2a494e5ef3a2f0dc24477d8688a7a842cc /gtk2_ardour/midi_region_view.cc
parent42b5ed3904f15df77c3a3c18e334fa422911387d (diff)
Fix note resizing.
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r--gtk2_ardour/midi_region_view.cc14
1 files 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);
}