From 0896e4cf25ff74830b3e8839fd8bfe5e56c97d9b Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 29 Feb 2024 18:23:23 -0800 Subject: [PATCH] Fix NaN value in Tween --- src/starling/animation/Tween.hx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/starling/animation/Tween.hx b/src/starling/animation/Tween.hx index 62ae2932..5cdb3ebb 100644 --- a/src/starling/animation/Tween.hx +++ b/src/starling/animation/Tween.hx @@ -240,7 +240,9 @@ import starling.utils.Color; var ratio:Float = __currentTime / __totalTime; var reversed:Bool = __reverse && (__currentCycle % 2 == 1); var numProperties:Int = __startValues.length; + __progress = reversed ? __transitionFunc(1.0 - ratio) : __transitionFunc(ratio); + if (__progress != __progress) __progress = 0; // isNaN check for (i in 0...numProperties) {