Add test showing filled heatmap

This commit is contained in:
Dan Balasescu 2024-02-06 21:56:26 +09:00
parent c18cd65081
commit 9e7912e663
No known key found for this signature in database
1 changed files with 25 additions and 1 deletions

View File

@ -54,7 +54,7 @@ public void Setup() => Schedule(() =>
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Size = new Vector2(130) Size = new Vector2(300)
} }
}; };
}); });
@ -85,6 +85,30 @@ public void TestManualPlacement()
AddStep("return user input", () => InputManager.UseParentInput = true); AddStep("return user input", () => InputManager.UseParentInput = true);
} }
[Test]
public void TestAllPoints()
{
AddStep("add points", () =>
{
float minX = object1.DrawPosition.X - object1.DrawSize.X / 2;
float maxX = object1.DrawPosition.X + object1.DrawSize.X / 2;
float minY = object1.DrawPosition.Y - object1.DrawSize.Y / 2;
float maxY = object1.DrawPosition.Y + object1.DrawSize.Y / 2;
for (int i = 0; i < 10; i++)
{
for (float x = minX; x <= maxX; x += 0.5f)
{
for (float y = minY; y <= maxY; y += 0.5f)
{
accuracyHeatmap.AddPoint(object2.Position, object1.Position, new Vector2(x, y), RNG.NextSingle(10, 500));
}
}
}
});
}
protected override bool OnMouseDown(MouseDownEvent e) protected override bool OnMouseDown(MouseDownEvent e)
{ {
accuracyHeatmap.AddPoint(object2.Position, object1.Position, background.ToLocalSpace(e.ScreenSpaceMouseDownPosition), 50); accuracyHeatmap.AddPoint(object2.Position, object1.Position, background.ToLocalSpace(e.ScreenSpaceMouseDownPosition), 50);