commit 9da7e5404558a17392e0c42126f73154a385ff75
parent e7bd80efcb94512964df8d50c76c3da30bd6f656
Author: Matt Demanett <matt@demanett.net>
Date: Sat, 14 May 2022 17:57:15 -0400
Fix bug with knobs on knob matrix mixers where the knob may not show the correct value of the underlying param. #204
Diffstat:
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/widgets.cpp b/src/widgets.cpp
@@ -235,10 +235,15 @@ void IndicatorKnob::onHover(const event::Hover& e) {
math::Vec c = box.size.div(2);
float dist = e.pos.minus(c).norm();
if (dist <= c.x) {
- ParamWidget::onHover(e);
+ Knob::onHover(e);
}
}
+void IndicatorKnob::onLeave(const LeaveEvent& e) {
+ Knob::onLeave(e);
+ redraw();
+}
+
void IndicatorKnob::onChange(const event::Change& e) {
fb->dirty = true;
if (getParamQuantity()) {
diff --git a/src/widgets.hpp b/src/widgets.hpp
@@ -104,6 +104,7 @@ struct IndicatorKnob : LightEmittingWidget<Knob>, SkinnableWidget {
IndicatorKnob(int dim);
void onHover(const event::Hover& e) override;
+ void onLeave(const LeaveEvent& e) override;
void onChange(const event::Change& e) override;
inline void setDrawColorsCallback(std::function<bool()> fn) { w->_drawColorsCB = fn; }
inline void setUnipolarCallback(std::function<bool()> fn) { w->_unipolarCB = fn; }