From a4dc05f603c5de1748752eb6e078a2415f17532f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 15 Jan 2014 09:45:02 +0100 Subject: fix invalid width when swiching to 2in2out --- libs/panners/2in2out/panner_2in2out.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libs/panners') diff --git a/libs/panners/2in2out/panner_2in2out.cc b/libs/panners/2in2out/panner_2in2out.cc index f801a36ff4..463b2671bb 100644 --- a/libs/panners/2in2out/panner_2in2out.cc +++ b/libs/panners/2in2out/panner_2in2out.cc @@ -78,7 +78,14 @@ Panner2in2out::Panner2in2out (boost::shared_ptr p) if (!_pannable->has_state()) { _pannable->pan_azimuth_control->set_value (0.5); _pannable->pan_width_control->set_value (1.0); - } + } + + double const w = width(); + double const wrange = min (position(), (1 - position())) * 2; + if (fabs(w) > wrange) { + set_width(w > 0 ? wrange : -wrange); + } + update (); -- cgit v1.2.3