mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 03:22:55 +08:00
mode selector line has the correct length now
This commit is contained in:
parent
6e0a2ec7da
commit
1978984006
@ -31,6 +31,10 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y;
|
RelativeSizeAxes = Axes.Y;
|
||||||
|
|
||||||
|
float length = Enum.GetValues(typeof(PlayMode)).Length * ToolbarButton.WIDTH + padding*2;
|
||||||
|
float lineLength = (padding * 2 + ToolbarButton.WIDTH) / length;
|
||||||
|
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new OpaqueBackground(),
|
new OpaqueBackground(),
|
||||||
@ -41,12 +45,12 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirection.HorizontalOnly,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Padding = new MarginPadding { Left = 10, Right = 10 },
|
Padding = new MarginPadding { Left = padding, Right = padding },
|
||||||
},
|
},
|
||||||
modeButtonLine = new Container
|
modeButtonLine = new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Size = new Vector2(0.3f, 3),
|
Size = new Vector2(lineLength, 3),
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.TopLeft,
|
Origin = Anchor.TopLeft,
|
||||||
Masking = true,
|
Masking = true,
|
||||||
|
Loading…
Reference in New Issue
Block a user