Skip to content

Commit 3b5e47a

Browse files
committed
[csharp] Port of commit 5d87203: Fixed additive timelines. Disallow additive for slider and path mix timelines.
1 parent 76601d9 commit 3b5e47a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spine-csharp/src/Animation.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ public float GetRelativeValue (float time, float alpha, bool fromSetup, bool add
472472
public float GetAbsoluteValue (float time, float alpha, bool fromSetup, bool add, float current, float setup) {
473473
if (time < frames[0]) return fromSetup ? setup : current;
474474
float value = GetCurveValue(time);
475-
return fromSetup ? setup + (value - setup) * alpha : current + (add ? value : value - current) * alpha;
475+
return fromSetup ? setup + (add ? value : value - setup) * alpha : current + (add ? value : value - current) * alpha;
476476
}
477477

478478
/// <summary>Returns the interpolated value for properties set as absolute values, using the specified timeline value rather than
@@ -484,7 +484,7 @@ public float GetAbsoluteValue (float time, float alpha, bool fromSetup, bool add
484484
public float GetAbsoluteValue (float time, float alpha, bool fromSetup, bool add, float current, float setup,
485485
float value) {
486486
if (time < frames[0]) return fromSetup ? setup : current;
487-
return fromSetup ? setup + (value - setup) * alpha : current + (add ? value : value - current) * alpha;
487+
return fromSetup ? setup + (add ? value : value - setup) * alpha : current + (add ? value : value - current) * alpha;
488488
}
489489

490490
/// <summary>Returns the interpolated value for scale properties. The timeline and setup values are multiplied and sign adjusted.</summary>
@@ -2263,7 +2263,6 @@ public class PathConstraintMixTimeline : CurveTimeline, IConstraintTimeline {
22632263
public PathConstraintMixTimeline (int frameCount, int bezierCount, int constraintIndex)
22642264
: base(frameCount, bezierCount, (ulong)Property.PathConstraintMix << 53 | (uint)constraintIndex) {
22652265
this.constraintIndex = constraintIndex;
2266-
additive = true;
22672266
}
22682267

22692268
public override int FrameEntries {
@@ -2585,7 +2584,6 @@ override public void Apply (Skeleton skeleton, float lastTime, float time, Expos
25852584
public class SliderTimeline : ConstraintTimeline1 {
25862585
public SliderTimeline (int frameCount, int bezierCount, int constraintIndex)
25872586
: base(frameCount, bezierCount, constraintIndex, Property.SliderTime) {
2588-
additive = true;
25892587
}
25902588

25912589
/// <param name="events">May be null.</param>

0 commit comments

Comments
 (0)