Has anyone experienced a snapping issue with a slider who’s range crosses zero?
Slider myslider(Slider::LinearVertical, Slider::NoTextBox); myslider.setRange (-1.0f, 1.0f, 0.01f); myslider.setValue (0.0f); DBG(myslider.getValue());
I get -2.23517e-08 as the debug output! Zero should snap to zero as its an integral multiple of my interval from either min or max.
Inspection with the debugger of the snapToLegalValue() function , I notice the interval is 0.0099999997764825821 but that may be normal. Unfortunately, I don’t think the snapToLegalValueFunction is exposed to Slider settings, but I did find a workaround. Just to set the range from 0-2 and then map to and from that range in my code, and set the textFromValueFunction lambda accordingly.
So just wondering if anyone has any thoughts on this. Have I made a mistake? Should I do something different for ranges crossing zero? Or is there an issue in the NormalisableRange class in this case?