From 842c96a5110b2b3ac2a110612923a077184221ef Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Wed, 1 Oct 2025 10:40:57 +0200 Subject: [PATCH] [haxe] Port of commit 64ed135: Fixed having a physics reset all timeline in a slider animation. --- spine-haxe/spine-haxe/spine/Slider.hx | 7 +++++-- .../spine-haxe/spine/animation/ConstraintTimeline.hx | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) 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; }