Rotary sliders getting weird values


#1

Hi everybody.

I have some rotary sliders. The range is [0.f ; 1.f], but it seems that the rotary sliders disregard this sometimes. When I turn them all the way down, my indicator on the knob disappears, because the value of the rotary slider falls out of range - when I release the mouse button in this state, the indicator jumps (along with the value) to maximum position.

I’m using a skewFactor of 3.f with horizontal dragging style. Now here’s the real downer: everything is perfect in the debug version, but as I build for release, there’s the problem.

Any similar experiences…? Thanks in advance. Oh - it’s Juce version 1.21

-A


#2

No worries, I changed the following:

double Slider::proportionOfLengthToValue (double proportion)
{
/my new line/ if (proportion == 0.f) return minimum;
if (skewFactor != 1.0)
proportion = exp (log (proportion) / skewFactor);

return minimum + (maximum - minimum) * proportion;

}

The problem is log (0) - this may be controlled in the debug-version, but returning some undefined value in release…? Not the best way of treating potential error, but hey… I haven’t the time to think the solution through, but it tests fine for my purpose :slight_smile:

-A


#3

In fact, this was fixed many versions ago - V1.21 is way out of date!


#4

Yeah, I had a feeling it might be so. An upgrade to the newest Juce is right around the corner for me :wink:

-Thanks


#5