From 231eefc247d194eb01bb539185edb5f2c6dddf0a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 23 Mar 2012 22:56:00 +0000 Subject: Patch from colinf to make stereo panners move right with the mouse (#4702). git-svn-id: svn://localhost/ardour2/branches/3.0@11753 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/stereo_panner.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/stereo_panner.cc b/gtk2_ardour/stereo_panner.cc index 43fae05e7b..83e51a5540 100644 --- a/gtk2_ardour/stereo_panner.cc +++ b/gtk2_ardour/stereo_panner.cc @@ -469,8 +469,8 @@ StereoPanner::on_motion_notify_event (GdkEventMotion* ev) return false; } - int w = get_width(); - double delta = (ev->x - last_drag_x) / (double) w; + int usable_width = get_width() - lr_box_size; + double delta = (ev->x - last_drag_x) / (double) usable_width; double current_width = width_control->get_value (); if (dragging_left) { @@ -503,7 +503,8 @@ StereoPanner::on_motion_notify_event (GdkEventMotion* ev) } } else { - width_control->set_value (current_width + delta); + /* width needs to change by 2 * delta because both L & R move */ + width_control->set_value (current_width + delta * 2); } } else if (dragging_position) { -- cgit v1.2.3