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
This commit is contained in:
Carl Hetherington 2012-03-23 22:56:00 +00:00
parent d9d0c6b0b3
commit 231eefc247

View file

@ -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) {