diff --git a/spine-haxe/spine-haxe/spine/Slider.hx b/spine-haxe/spine-haxe/spine/Slider.hx index 1fdd39074..e5b73c590 100644 --- a/spine-haxe/spine-haxe/spine/Slider.hx +++ b/spine-haxe/spine-haxe/spine/Slider.hx @@ -117,8 +117,11 @@ class Slider extends Constraint { skeleton.constrained(physics[ii]); } else skeleton.constrained(constraints[timeline.constraintIndex]); - } else if (Std.isOfType(t, ConstraintTimeline)) // - skeleton.constrained(constraints[cast(t, ConstraintTimeline).getConstraintIndex()]); + } else if (Std.isOfType(t, ConstraintTimeline)) { + var constraintIndex = cast(t, ConstraintTimeline).getConstraintIndex(); + if (constraintIndex != -1) + skeleton.constrained(constraints[constraintIndex]); + } } } } diff --git a/spine-haxe/spine-haxe/spine/animation/ConstraintTimeline.hx b/spine-haxe/spine-haxe/spine/animation/ConstraintTimeline.hx index 751e243d2..38fb973ad 100644 --- a/spine-haxe/spine-haxe/spine/animation/ConstraintTimeline.hx +++ b/spine-haxe/spine-haxe/spine/animation/ConstraintTimeline.hx @@ -30,6 +30,7 @@ package spine.animation; interface ConstraintTimeline { - /** The index of the constraint in spine.Skeleton.constraints that will be changed when this timeline is applied. */ + /** The index of the constraint in spine.Skeleton.constraints that will be changed when this timeline is applied, or + * -1 if a specific constraint will not be changed. */ public function getConstraintIndex():Int; }