From c80a459faf3abcbe67969664663a3b9ed82966f7 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 19 Jul 2018 17:54:51 +0200 Subject: Use range when assigning default knob value. --- plugingui/knob.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugingui/knob.cc b/plugingui/knob.cc index aaf9735..3d09d51 100644 --- a/plugingui/knob.cc +++ b/plugingui/knob.cc @@ -150,8 +150,12 @@ void Knob::buttonEvent(ButtonEvent* buttonEvent) return; } - if (buttonEvent->doubleClick) { - internalSetValue(default_value); + if(buttonEvent->doubleClick) + { + float value = default_value; + value -= minimum; + value /= (maximum - minimum); + internalSetValue(value); return; } -- cgit v1.2.3