Fix ADV and BUNKI animation polish
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Age.Engine.Hosting;
|
||||
using Age.Engine.Model;
|
||||
using Age.Engine.Sys4;
|
||||
using Age.Engine.Vm;
|
||||
@@ -106,6 +108,22 @@ public class AdvTextOpsTests
|
||||
Assert.Single(host.WaitIndicators));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WaitIndicatorTerminalFrameIsExclusive()
|
||||
{
|
||||
var config = new AdvWaitIndicatorConfig(
|
||||
1, 385, 140, 12, 0, 0, 30, 27, 12, 48);
|
||||
|
||||
int[] frames = Enumerable.Range(0, 24)
|
||||
.Select(tick => config.FrameAt(tick * 48L))
|
||||
.ToArray();
|
||||
|
||||
Assert.Equal(
|
||||
Enumerable.Range(0, 12).Concat(Enumerable.Range(0, 12)),
|
||||
frames);
|
||||
Assert.DoesNotContain(12, frames);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WaitIndicatorToggleAndTextLayoutPublicationReachHost()
|
||||
{
|
||||
|
||||
@@ -72,5 +72,16 @@ public class GfxRangeTransformTests
|
||||
Assert.NotNull(vm.Gfx.SnapshotVisibleObjects().Single().RangeTransform);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BunkiAnimationPublicationExcludesStablePopupHandles()
|
||||
{
|
||||
var animationRange = new GfxHandleRange(0, 60000);
|
||||
|
||||
Assert.True(animationRange.Contains(59999));
|
||||
Assert.False(animationRange.Contains(60000));
|
||||
Assert.False(animationRange.Contains(60050));
|
||||
Assert.True(GfxHandleRange.All.Contains(60050));
|
||||
}
|
||||
|
||||
private static Operand I(long v) => new(0, v);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,19 @@ public class Transform2DMathTests
|
||||
Assert.Equal(0, allocated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanvasAxisDecompositionPreservesBunkiPopupScale()
|
||||
{
|
||||
var affine = Transform2DMath.Build(new TransformState(
|
||||
0.05, 0.65, 1, 0, 0, 0, 400, 300, 0));
|
||||
|
||||
var (rotation, scaleX, scaleY) = affine.DecomposeCanvasAxes();
|
||||
|
||||
Assert.Equal(0, rotation, 12);
|
||||
Assert.Equal(0.05, scaleX, 12);
|
||||
Assert.Equal(0.65, scaleY, 12);
|
||||
}
|
||||
|
||||
private static double Next(Random random, double minimum, double maximum)
|
||||
=> minimum + random.NextDouble() * (maximum - minimum);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user