2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-12-11 21:21:25 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
2017-12-11 20:56:58 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using OpenTK;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Edit.Layers.Selection
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2017-12-18 18:21:26 +08:00
|
|
|
|
/// Represents the origin of a <see cref="HandleContainer"/>.
|
2017-12-11 20:56:58 +08:00
|
|
|
|
/// </summary>
|
2017-12-18 18:21:26 +08:00
|
|
|
|
public class OriginHandle : CompositeDrawable
|
2017-12-11 20:56:58 +08:00
|
|
|
|
{
|
|
|
|
|
private const float marker_size = 10;
|
|
|
|
|
private const float line_width = 2;
|
|
|
|
|
|
2017-12-18 18:21:26 +08:00
|
|
|
|
public OriginHandle()
|
2017-12-11 20:56:58 +08:00
|
|
|
|
{
|
|
|
|
|
Size = new Vector2(marker_size);
|
|
|
|
|
|
|
|
|
|
InternalChildren = new[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Height = line_width
|
|
|
|
|
},
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
|
Width = line_width
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
Colour = colours.Yellow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|