diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-07-19 17:54:51 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-07-19 17:54:51 +0200 |
commit | c80a459faf3abcbe67969664663a3b9ed82966f7 (patch) | |
tree | b14ee2c30ef916c5126dc791e20af26fc8cd85ef /plugingui/knob.cc | |
parent | 966e57b6865c1fa3826c68fc54668ca102b29512 (diff) |
Use range when assigning default knob value.
Diffstat (limited to 'plugingui/knob.cc')
-rw-r--r-- | plugingui/knob.cc | 8 |
1 files 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; } |