Make heatmap support dynamic sizing

This commit is contained in:
smoogipoo
2020-06-16 16:31:02 +09:00
parent a65c1a9abd
commit 9ea7c3dc90
2 changed files with 108 additions and 63 deletions

View File

@ -20,7 +20,7 @@ namespace osu.Game.Tests.Visual.Ranking
private readonly Box background;
private readonly Drawable object1;
private readonly Drawable object2;
private readonly Heatmap heatmap;
private readonly TestHeatmap heatmap;
public TestSceneAccuracyHeatmap()
{
@ -40,10 +40,11 @@ namespace osu.Game.Tests.Visual.Ranking
{
Position = new Vector2(500, 300),
},
heatmap = new Heatmap(new List<HitOffset>())
heatmap = new TestHeatmap(new List<HitOffset>())
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(130)
}
};
}
@ -70,6 +71,17 @@ namespace osu.Game.Tests.Visual.Ranking
return true;
}
private class TestHeatmap : Heatmap
{
public TestHeatmap(IReadOnlyList<HitOffset> offsets)
: base(offsets)
{
}
public new void AddPoint(Vector2 start, Vector2 end, Vector2 hitPoint, float radius)
=> base.AddPoint(start, end, hitPoint, radius);
}
private class BorderCircle : CircularContainer
{
public BorderCircle()