From b638c3f6b068e9152ce90b0e3a18333b35443ce7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 1 Jan 2011 17:34:06 +0000 Subject: [PATCH] fix reversed dragging in stereo panner when width is negative git-svn-id: svn://localhost/ardour2/branches/3.0@8403 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/stereo_panner.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/stereo_panner.cc b/gtk2_ardour/stereo_panner.cc index 7ab526f8fa..6b2561ce7a 100644 --- a/gtk2_ardour/stereo_panner.cc +++ b/gtk2_ardour/stereo_panner.cc @@ -393,11 +393,18 @@ StereoPanner::on_button_press_event (GdkEventButton* ev) const int half_box = lr_box_size/2; if (ev->x >= (left - half_box) && ev->x < (left + half_box)) { - dragging_left = true; + if (swidth < 0.0) { + dragging_right = true; + } else { + dragging_left = true; + } } else if (ev->x >= (right - half_box) && ev->x < (right + half_box)) { - dragging_right = true; + if (swidth < 0.0) { + dragging_left = true; + } else { + dragging_right = true; + } } - } dragging = true; @@ -505,6 +512,7 @@ StereoPanner::on_motion_notify_event (GdkEventMotion* ev) int w = get_width(); double delta = (ev->x - last_drag_x) / (double) w; + double current_width = width_control->get_value (); if (dragging_left) { delta = -delta; @@ -514,7 +522,6 @@ StereoPanner::on_motion_notify_event (GdkEventMotion* ev) /* maintain position as invariant as we change the width */ - double current_width = width_control->get_value (); /* create a detent close to the center */