When using the mouse wheel in strictly one direction, it is possible to move a Slider in BOTH directions!
When moving slowly or quickly, the slider moves in the expected direction. But with the right speed somewhere in between, the slider moves in the opposite direction.
I tried to figure this out by myself, but strangely Slider::Pimpl::mouseWheelMove was never hit in XCode 5. I outcommented
if (e.eventTime != lastMouseWheelTime)
as well as
(wheel.isReversed ? -1.0f : 1.0f)
but neighter changed the situation.
This happens in my own application as well as in the JUCE demo and even in Tracktion.
I tried it with a Logitech mouse as well as with the Trackpad of my Macbook under OSX 10.9.4.
No, sadly not. It also happens with an actual (1-axis) wheel on a real mouse.
Please try it with the Demo yourself. Scroll until the max or min of the slider is reached. Then continue with different scrolling speeds. The slider moves to the other direction.
And no, no custom modifications (I git stashed) and the latest Juce.
Edit: The issue on the real mouse happens only when the scroll wheel stopps. Sometimes it communicates a delta value into the other direction. So this is a hardware problem.
You were right, the reason is some slight simultaneous horizontal scrolling.
I was confused because it did not happen on horizontal scrolling - even thought there were also some deltaY !=0 . The reason is this line in Slider::Pimpl::mouseWheelMove:
Sure, it could use 1.0 instead of 1.0f, but since deltaX/Y are floats it won't make any significant difference to the value, it just changes the stage at which the float->double conversion happens.