mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 12:02:54 +08:00
Make SetupCircularButton adjust corner radius by height
This commit is contained in:
parent
9eb47ae691
commit
10b8708d4e
45
osu.Game.Tests/Visual/TestCaseEditorSetupCircularButton.cs
Normal file
45
osu.Game.Tests/Visual/TestCaseEditorSetupCircularButton.cs
Normal file
@ -0,0 +1,45 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Screens.Edit.Screens.Setup.Components;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual
|
||||
{
|
||||
public class TestCaseEditorSetupCircularButton : OsuTestCase
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Child = new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new[]
|
||||
{
|
||||
new SetupCircularButton { Text = "Default" },
|
||||
new SetupCircularButton
|
||||
{
|
||||
Width = 200,
|
||||
Text = "Wide",
|
||||
},
|
||||
new SetupCircularButton
|
||||
{
|
||||
Height = 100,
|
||||
Text = "High"
|
||||
},
|
||||
new SetupCircularButton
|
||||
{
|
||||
Size = new Vector2(200, 100),
|
||||
Text = "Wide 'n' High"
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -2,7 +2,6 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Screens.Setup.Components
|
||||
@ -17,10 +16,10 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components
|
||||
Size = new Vector2(width, height);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
protected override void Update()
|
||||
{
|
||||
Content.CornerRadius = 15;
|
||||
base.Update();
|
||||
Content.CornerRadius = DrawHeight / 2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user