Combine border radiuses of selection and capture boxes

This commit is contained in:
smoogipoo
2018-02-20 14:25:42 +09:00
parent 63c8b11c2c
commit 423fe4eba8
2 changed files with 10 additions and 21 deletions

View File

@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
this.capturedObjects = capturedObjects; this.capturedObjects = capturedObjects;
Masking = true; Masking = true;
BorderThickness = 3; BorderThickness = SelectionBox.BORDER_RADIUS;
InternalChild = new Box InternalChild = new Box
{ {

View File

@ -14,32 +14,21 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
/// </summary> /// </summary>
public class SelectionBox : VisibilityContainer public class SelectionBox : VisibilityContainer
{ {
public const float BORDER_RADIUS = 2;
/// <summary> /// <summary>
/// Creates a new <see cref="SelectionBox"/>. /// Creates a new <see cref="SelectionBox"/>.
/// </summary> /// </summary>
public SelectionBox() public SelectionBox()
{ {
InternalChildren = new Drawable[] Masking = true;
{ BorderColour = Color4.White;
new Container BorderThickness = BORDER_RADIUS;
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(-1),
Child = new Container
{
RelativeSizeAxes = Axes.Both,
Masking = true,
BorderColour = Color4.White,
BorderThickness = 2,
MaskingSmoothness = 1,
Child = new Box Child = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Alpha = 0.1f, Alpha = 0.1f
AlwaysPresent = true
},
}
}
}; };
} }