From 7b66abc7aafb47179b7a683d6a0ec5b7c59645cb Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 26 Jun 2009 12:20:11 +0000 Subject: [PATCH] Fix automation control point dragging. git-svn-id: svn://localhost/ardour2/branches/3.0@5278 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_drag.cc | 12 ++++++++++++ gtk2_ardour/editor_drag.h | 4 +--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index b1176d33e3..b9906eda5b 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2532,6 +2532,18 @@ ControlPointDrag::finished (GdkEvent* event, bool movement_occurred) _point->line().end_drag (_point); } +bool +ControlPointDrag::active (Editing::MouseMode m) +{ + if (m == Editing::MouseGain) { + /* always active in mouse gain */ + return true; + } + + /* otherwise active if the point is on an automation line (ie not if its on a region gain line) */ + return dynamic_cast (&(_point->line())) != 0; +} + LineDrag::LineDrag (Editor* e, ArdourCanvas::Item* i) : Drag (e, i), _line (0), diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index b01ba78709..97e503f0d6 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -404,9 +404,7 @@ public: void motion (GdkEvent *, bool); void finished (GdkEvent *, bool); - bool active (Editing::MouseMode m) { - return (m == Editing::MouseGain); - } + bool active (Editing::MouseMode m); private: