diff --git a/dpf/dgl/src/ImageWidgets.cpp b/dpf/dgl/src/ImageWidgets.cpp index de94ca02..94bf58a1 100644 --- a/dpf/dgl/src/ImageWidgets.cpp +++ b/dpf/dgl/src/ImageWidgets.cpp @@ -612,8 +612,9 @@ bool ImageKnob::onScroll(const ScrollEvent& ev) if (! contains(ev.pos)) return false; + const float dir = (ev.delta.getY() > 0.f) ? 1.f : -1.f; const float d = (ev.mod & kModifierControl) ? 2000.0f : 200.0f; - float value = (fUsingLog ? _invlogscale(fValueTmp) : fValueTmp) + (float(fMaximum - fMinimum) / d * 10.f * ev.delta.getY()); + float value = (fUsingLog ? _invlogscale(fValueTmp) : fValueTmp) + (float(fMaximum - fMinimum) / d * 10.f * dir); if (fUsingLog) value = _logscale(value);