fix for crash while drag-creating a new MIDI note and dragging before the start of...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 Jan 2012 01:59:39 +0000 (01:59 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 Jan 2012 01:59:39 +0000 (01:59 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11396 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_drag.cc

index 692ca864b5621122472b79cf5604e9c3fff0998e..c0c73d40e5930ad5915a367f0bb12a3bc6388ab1 100644 (file)
@@ -4523,7 +4523,7 @@ NoteCreateDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
 void
 NoteCreateDrag::motion (GdkEvent* event, bool)
 {
-       _note[1] = adjusted_current_frame (event) - _region_view->region()->position ();
+       _note[1] = max ((framepos_t)0, adjusted_current_frame (event) - _region_view->region()->position ());
        double const x = _editor->frame_to_pixel (_note[1]);
        if (_note[1] > _note[0]) {
                _drag_rect->property_x2() = x;