\r
/** If {@link #setAnimateDuration(float) animating} the slider value, this returns the value current displayed. */\r
public float getVisualValue () {\r
- if (animateTime > 0) return animateInterpolation.apply(animateFromValue, value, animateTime / animateDuration);\r
+ if (animateTime > 0) return animateInterpolation.apply(animateFromValue, value, 1 - animateTime / animateDuration);\r
return value;\r
}\r
\r
value = MathUtils.clamp(Math.round(value / stepSize) * stepSize, min, max);\r
float oldValue = this.value;\r
if (value == oldValue) return;\r
+ float oldVisualValue = getVisualValue();\r
this.value = value;\r
ChangeEvent changeEvent = Pools.obtain(ChangeEvent.class);\r
if (fire(changeEvent))\r
this.value = oldValue;\r
else if (animateDuration > 0) {\r
+ animateFromValue = oldVisualValue;\r
animateTime = animateDuration;\r
- animateFromValue = getVisualValue();\r
}\r
Pools.free(changeEvent);\r
}\r