Marker* -> Handle

This commit is contained in:
smoogipoo 2017-12-18 19:21:26 +09:00
parent 3999940538
commit 09c51df2bd
5 changed files with 130 additions and 130 deletions

View File

@ -15,32 +15,32 @@ using OpenTK.Graphics;
namespace osu.Game.Rulesets.Edit.Layers.Selection
{
/// <summary>
/// Represents a marker visible on the border of a <see cref="MarkerContainer"/> which exposes
/// Represents a marker visible on the border of a <see cref="HandleContainer"/> which exposes
/// properties that are used to resize a <see cref="HitObjectSelectionBox"/>.
/// </summary>
public class Marker : CompositeDrawable
public class Handle : CompositeDrawable
{
private const float marker_size = 10;
/// <summary>
/// Invoked when this <see cref="Marker"/> requires the current drag rectangle.
/// Invoked when this <see cref="Handle"/> requires the current drag rectangle.
/// </summary>
public Func<RectangleF> GetDragRectangle;
/// <summary>
/// Invoked when this <see cref="Marker"/> wants to update the drag rectangle.
/// Invoked when this <see cref="Handle"/> wants to update the drag rectangle.
/// </summary>
public Action<RectangleF> UpdateDragRectangle;
/// <summary>
/// Invoked when this <see cref="Marker"/> has finished updates to the drag rectangle.
/// Invoked when this <see cref="Handle"/> has finished updates to the drag rectangle.
/// </summary>
public Action FinishCapture;
private Color4 normalColour;
private Color4 hoverColour;
public Marker()
public Handle()
{
Size = new Vector2(marker_size);

View File

@ -11,77 +11,77 @@ using osu.Framework.Graphics.Primitives;
namespace osu.Game.Rulesets.Edit.Layers.Selection
{
/// <summary>
/// A <see cref="CompositeDrawable"/> that has <see cref="Marker"/>s around its border.
/// A <see cref="CompositeDrawable"/> that has <see cref="Handle"/>s around its border.
/// </summary>
public class MarkerContainer : CompositeDrawable
public class HandleContainer : CompositeDrawable
{
/// <summary>
/// Invoked when a <see cref="Marker"/> requires the current drag rectangle.
/// Invoked when a <see cref="Handle"/> requires the current drag rectangle.
/// </summary>
public Func<RectangleF> GetDragRectangle;
/// <summary>
/// Invoked when a <see cref="Marker"/> wants to update the drag rectangle.
/// Invoked when a <see cref="Handle"/> wants to update the drag rectangle.
/// </summary>
public Action<RectangleF> UpdateDragRectangle;
/// <summary>
/// Invoked when a <see cref="Marker"/> has finished updates to the drag rectangle.
/// Invoked when a <see cref="Handle"/> has finished updates to the drag rectangle.
/// </summary>
public Action FinishCapture;
public MarkerContainer()
public HandleContainer()
{
InternalChildren = new Drawable[]
{
new Marker
new Handle
{
Anchor = Anchor.TopLeft,
Origin = Anchor.Centre
},
new Marker
new Handle
{
Anchor = Anchor.TopCentre,
Origin = Anchor.Centre
},
new Marker
new Handle
{
Anchor = Anchor.TopRight,
Origin = Anchor.Centre
},
new Marker
new Handle
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.Centre
},
new Marker
new Handle
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.Centre
},
new Marker
new Handle
{
Anchor = Anchor.CentreRight,
Origin = Anchor.Centre
},
new Marker
new Handle
{
Anchor = Anchor.BottomRight,
Origin = Anchor.Centre
},
new Marker
new Handle
{
Anchor = Anchor.BottomCentre,
Origin = Anchor.Centre
},
new CentreMarker
new OriginHandle
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre
}
};
InternalChildren.OfType<Marker>().ForEach(m =>
InternalChildren.OfType<Handle>().ForEach(m =>
{
m.GetDragRectangle = () => GetDragRectangle();
m.UpdateDragRectangle = r => UpdateDragRectangle(r);

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
private readonly Container borderMask;
private readonly Drawable background;
private readonly MarkerContainer markers;
private readonly HandleContainer handles;
private Color4 captureFinishedColour;
@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
},
}
},
markers = new MarkerContainer
handles = new HandleContainer
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
@ -159,7 +159,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
// Transform into markers to let the user modify the drag selection further.
background.Delay(50).FadeOut(200);
markers.FadeIn(200);
handles.FadeIn(200);
Selection.Value = new SelectionInfo
{

View File

@ -11,14 +11,14 @@ using OpenTK;
namespace osu.Game.Rulesets.Edit.Layers.Selection
{
/// <summary>
/// Represents the centre of a <see cref="MarkerContainer"/>.
/// Represents the origin of a <see cref="HandleContainer"/>.
/// </summary>
public class CentreMarker : CompositeDrawable
public class OriginHandle : CompositeDrawable
{
private const float marker_size = 10;
private const float line_width = 2;
public CentreMarker()
public OriginHandle()
{
Size = new Vector2(marker_size);

View File

@ -307,10 +307,10 @@
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
<Compile Include="Overlays\Settings\SettingsButton.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\CentreMarker.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\OriginHandle.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\HitObjectSelectionBox.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\Marker.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\MarkerContainer.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\Handle.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\HandleContainer.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\SelectionInfo.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\SelectionLayer.cs" />
<Compile Include="Screens\Edit\Components\BottomBarContainer.cs" />