Fix automation control point dragging.
authorCarl Hetherington <carl@carlh.net>
Fri, 26 Jun 2009 12:20:11 +0000 (12:20 +0000)
committerCarl Hetherington <carl@carlh.net>
Fri, 26 Jun 2009 12:20:11 +0000 (12:20 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@5278 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_drag.cc
gtk2_ardour/editor_drag.h

index b1176d33e3b97666072c05d5d69b9fbee85eb20d..b9906eda5b3ec876ec27b007980fef638626b5f3 100644 (file)
@@ -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<AutomationLine*> (&(_point->line())) != 0;
+}
+
 LineDrag::LineDrag (Editor* e, ArdourCanvas::Item* i)
        : Drag (e, i),
          _line (0),
index b01ba787090a7642592255fdff318523058d08a6..97e503f0d680de2829eb4fb3609cfbaf85e6bea3 100644 (file)
@@ -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: