From 0280989276acefe43e1fc0f5617703afc72c0d62 Mon Sep 17 00:00:00 2001 From: nick_m Date: Thu, 18 Jun 2015 04:42:30 +1000 Subject: [PATCH] Single control points can now be dragged up and down properly. - preserves the zero notch, but doesn't mess up the cumulative drag. --- gtk2_ardour/editor_drag.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 9f52dea5b6..056deea3f5 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -4091,11 +4091,6 @@ ControlPointDrag::motion (GdkEvent* event, bool) // positive side of zero double const zero_gain_y = (1.0 - _zero_gain_fraction) * _point->line().height() - .01; - // make sure we hit zero when passing through - if ((cy < zero_gain_y && (cy - dy) > zero_gain_y) || (cy > zero_gain_y && (cy - dy) < zero_gain_y)) { - cy = zero_gain_y; - } - if (_x_constrained) { cx = _fixed_grab_x; } @@ -4106,6 +4101,11 @@ ControlPointDrag::motion (GdkEvent* event, bool) _cumulative_x_drag = cx - _fixed_grab_x; _cumulative_y_drag = cy - _fixed_grab_y; + // make sure we hit zero when passing through + if ((cy < zero_gain_y && (cy - dy) > zero_gain_y) || (cy > zero_gain_y && (cy - dy) < zero_gain_y)) { + cy = zero_gain_y; + } + cx = max (0.0, cx); cy = max (0.0, cy); cy = min ((double) _point->line().height(), cy);