2023-06-23 00:37:25 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2020-05-29 15:40:10 +08:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Rulesets.Edit;
|
2021-05-13 18:53:32 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2020-05-29 15:40:10 +08:00
|
|
|
|
using osuTK;
|
|
|
|
|
|
2020-05-30 14:24:37 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Edit.Blueprints
|
2020-05-29 15:40:10 +08:00
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class TaikoSelectionBlueprint : HitObjectSelectionBlueprint
|
2020-05-29 15:40:10 +08:00
|
|
|
|
{
|
2021-05-13 18:53:32 +08:00
|
|
|
|
public TaikoSelectionBlueprint(HitObject hitObject)
|
2020-05-29 15:40:10 +08:00
|
|
|
|
: base(hitObject)
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.None;
|
|
|
|
|
|
|
|
|
|
AddInternal(new HitPiece
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Origin = Anchor.TopLeft
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
|
|
// Move the rectangle to cover the hitobjects
|
|
|
|
|
var topLeft = new Vector2(float.MaxValue, float.MaxValue);
|
|
|
|
|
var bottomRight = new Vector2(float.MinValue, float.MinValue);
|
|
|
|
|
|
2023-10-17 16:40:44 +08:00
|
|
|
|
topLeft = Vector2.ComponentMin(topLeft, Parent!.ToLocalSpace(DrawableObject.ScreenSpaceDrawQuad.TopLeft));
|
|
|
|
|
bottomRight = Vector2.ComponentMax(bottomRight, Parent!.ToLocalSpace(DrawableObject.ScreenSpaceDrawQuad.BottomRight));
|
2020-05-29 15:40:10 +08:00
|
|
|
|
|
|
|
|
|
Size = bottomRight - topLeft;
|
|
|
|
|
Position = topLeft;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|