Sliders "wobble" when moving down [SOLVED]

I have this issue where a slider is jumping to the bottom when moving down then back to the mouse, see for yourself:

Sorry for the terrible gif quality, but it gets the point across…

vokoscreen-2019-06-17_17-28-46

note that this is a custom slider subclass in order to allow for custom graphics.

I’m sure it’s not about my drawing function (I tried removing it and the basic JUCE slider had the same issue). Other than that I’m not overriding any drag functionality.

It seems like the mapping from mouse position to slider value is off.
Have you tried to override the drawing methods in LookAndFeel instead of inheriting the slider?
The Slider is a monster class, so easy to get wound up in the gears.

I literally just replaced the slider with a vanilla JUCE::Slider and the same thing happens. What I’m doing to the slider:

m_attack.setSliderStyle(juce::Slider::SliderStyle::LinearVertical);
m_attack.setRange(A_LOW_LIMIT, A_HIGH_LIMIT);
m_attack.setDoubleClickReturnValue(true, A_DEFAULT, ModifierKeys::ctrlModifier);
m_attack.setTooltip("Attack\nDefines how long the envelope takes to reach the top peak");
m_attack.setSkewFactorFromMidPoint(A_MID_VALUE);

Is it attached to a SliderAttachment? And are the ranges of the Parameter and the Slider identical?
N.B. if you attach to a parameter, the Range and skew is copied over automatically, no need to set anything in the slider itself

Yes and yes.

How do I set a skew for the audioparam? right now I’m attaching and then setting the value again. maybe this is causing trouble?

std::make_unique<AudioParameterFloat>("env1_attack", "AmpEnv Attack",
                                            0.001f, 10.f, 0.01f),

sounds like a message is doubling back and calling set value on the slider with the wrong value mid drag, put a breakpoint in set value perhaps and see if it’s coming from somewhere aside from the UI

1 Like

if you are on develop, the AudioParameterFloat takes a NormalisableRange as argument, wich has the skew as 4th argument.
And with an attachment you don’t need any setValue calls yourself

Yep, setting the audio param with the same skew fixed it. They were conflicting all the time. :slight_smile:

Thanks to both of you! :heart: