X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_drag.cc;h=cff5a233e33c11cc189f890421d1bd2677035e36;hb=5cf4a32da9fa3161f1e35b3a0e07c0056b682e7b;hp=d8209d4b518a38fbcbcff6daaeb63f3926c10274;hpb=59076a7e4c66db12bbbfbf01f012ca2f6ba4bf56;p=ardour.git diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index d8209d4b51..cff5a233e3 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3318,10 +3318,24 @@ LineDrag::motion (GdkEvent* event, bool) } void -LineDrag::finished (GdkEvent* event, bool) +LineDrag::finished (GdkEvent* event, bool movement_occured) { - motion (event, false); - _line->end_drag (false, 0); + if (movement_occured) { + motion (event, false); + _line->end_drag (false, 0); + } else { + /* add a new control point on the line */ + + AutomationTimeAxisView* atv; + + _line->end_drag (false, 0); + + if ((atv = dynamic_cast(_editor->clicked_axisview)) != 0) { + framepos_t where = _editor->event_frame (event, 0, 0); + atv->add_automation_event (event, where, event->button.y, false); + } + } + _editor->session()->commit_reversible_command (); }