diff options
author | Robin Gareus <robin@gareus.org> | 2014-01-15 09:45:02 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-01-15 09:45:02 +0100 |
commit | a4dc05f603c5de1748752eb6e078a2415f17532f (patch) | |
tree | c65308100ac0decf3246b9dac5a70a8518197769 /libs | |
parent | 58def58bf50f29e42babdb5de7ca34819c00909f (diff) |
fix invalid width when swiching to 2in2out
Diffstat (limited to 'libs')
-rw-r--r-- | libs/panners/2in2out/panner_2in2out.cc | 9 |
1 files changed, 8 insertions, 1 deletions
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<Pannable> 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 (); |