diff --git a/src/app/Knob.cpp b/src/app/Knob.cpp index fbb5ee37..f47f3349 100644 --- a/src/app/Knob.cpp +++ b/src/app/Knob.cpp @@ -18,7 +18,11 @@ void Knob::onDragStart(EventDragStart &e) { void Knob::onDragMove(EventDragMove &e) { // Drag slower if Mod - float delta = KNOB_SENSITIVITY * (maxValue - minValue) * -e.mouseRel.y * speed; + float range = maxValue - minValue; + float delta = KNOB_SENSITIVITY * -e.mouseRel.y * speed; + if (std::isfinite(range)) + delta *= range; + if (guiIsModPressed()) delta /= 16.0; dragValue += delta; diff --git a/src/app/SVGKnob.cpp b/src/app/SVGKnob.cpp index ae25ddb3..fc96b131 100644 --- a/src/app/SVGKnob.cpp +++ b/src/app/SVGKnob.cpp @@ -23,7 +23,9 @@ void SVGKnob::step() { // Re-transform TransformWidget if dirty if (dirty) { tw->box.size = box.size; - float angle = rescalef(value, minValue, maxValue, minAngle, maxAngle); + float angle = 0.0; + if (std::isfinite(minValue) && std::isfinite(maxValue)) + angle = rescalef(value, minValue, maxValue, minAngle, maxAngle); tw->identity(); // Scale SVG to box tw->scale(box.size.div(sw->box.size));