summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-14 00:31:28 -0500
committerDavid Robillard <d@drobilla.net>2014-11-14 00:31:28 -0500
commit3b23aed5e177959a331bf282a2107c71211a0946 (patch)
tree85a54c437e0c59e4553caed370ab4c6486495db4 /gtk2_ardour
parenta733a2a4c525fe021c66eb8b2eaccd3356462f75 (diff)
Fix error when create-dragging note backwards past start of region (#5934).
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/midi_region_view.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index d44b54bd8d..40c4af0924 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -3520,7 +3520,8 @@ MidiRegionView::update_ghost_note (double x, double y)
/* note that this sets the time of the ghost note in beats relative to
the start of the source; that is how all note times are stored.
*/
- _ghost_note->note()->set_time (absolute_frames_to_source_beats (f + _region->position ()));
+ _ghost_note->note()->set_time (
+ std::max(0.0, absolute_frames_to_source_beats (f + _region->position ())));
_ghost_note->note()->set_length (length);
_ghost_note->note()->set_note (midi_stream_view()->y_to_note (y));
_ghost_note->note()->set_channel (mtv->get_channel_for_add ());