1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 03:25:11 +08:00

Merge pull request #2092 from smoogipoo/fix-selection-border-radius

Combine border radiuses of selection and capture boxes
This commit is contained in:
Dean Herbert 2018-02-20 16:00:07 +09:00 committed by GitHub
commit e1a6017df9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
BorderThickness = BORDER_RADIUS;
Child = new Box
{ {
new Container RelativeSizeAxes = Axes.Both,
{ Alpha = 0.1f
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
{
RelativeSizeAxes = Axes.Both,
Alpha = 0.1f,
AlwaysPresent = true
},
}
}
}; };
} }