Skip to content

Commit a34ed8c

Browse files
committed
GTweenTimeline: don't set tween.position to NaN when calling addTween() if calculatedPosition is currently NaN
1 parent e1072dd commit a34ed8c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/com/gskinner/motion/GTweenTimeline.hx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,15 @@ class GTweenTimeline extends GTween {
147147
while (++index < tweens.length && tweenStartPositions[index] < position) { }
148148
tweens.insert(index,tween);
149149
tweenStartPositions.insert(index,position);
150-
tween.position = calculatedPosition-position;
150+
151+
if (Math.isNaN(calculatedPosition))
152+
{
153+
tween.position = 0.0-position;
154+
}
155+
else
156+
{
157+
tween.position = calculatedPosition-position;
158+
}
151159
}
152160

153161
/**

0 commit comments

Comments
 (0)