mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 02:23:06 +08:00
Fix bottom square being clipped
This commit is contained in:
parent
938f5eaf58
commit
bbca6cf602
@ -39,7 +39,7 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
List<int> newValues = new List<int>();
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
newValues.Add(RNG.Next(0, 11));
|
||||
newValues.Add(RNG.Next(0, 6));
|
||||
}
|
||||
|
||||
progress.Values = newValues.ToArray();
|
||||
|
@ -14,7 +14,6 @@ namespace osu.Game.Screens.Play
|
||||
public class SongProgress : OverlayContainer
|
||||
{
|
||||
private const int bar_height = 5;
|
||||
private const int graph_height = 34;
|
||||
private readonly Vector2 handleSize = new Vector2(14, 25);
|
||||
private readonly Color4 fillColour = new Color4(221, 255, 255, 255);
|
||||
private const float transition_duration = 200;
|
||||
@ -55,30 +54,30 @@ namespace osu.Game.Screens.Play
|
||||
public SongProgress()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = bar_height + graph_height + SongProgressGraph.Column.HEIGHT + handleSize.Y;
|
||||
Height = bar_height + SongProgressGraph.Column.HEIGHT + handleSize.Y;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
graph = new SongProgressGraph
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Origin = Anchor.BottomCentre,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Height = graph_height,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Height = SongProgressGraph.Column.HEIGHT,
|
||||
Margin = new MarginPadding
|
||||
{
|
||||
Bottom = bar_height
|
||||
}
|
||||
Bottom = bar_height,
|
||||
},
|
||||
},
|
||||
bar = new SongProgressBar(bar_height, graph_height, handleSize, fillColour)
|
||||
bar = new SongProgressBar(bar_height, SongProgressGraph.Column.HEIGHT, handleSize, fillColour)
|
||||
{
|
||||
Origin = Anchor.BottomCentre,
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Anchor = Anchor.BottomLeft,
|
||||
SeekRequested = delegate (float position)
|
||||
{
|
||||
OnSeek?.Invoke(Length * position);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,12 @@ using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
@ -124,6 +126,8 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
newColumns.Add(new Column
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Position = new Vector2(x, 0),
|
||||
State = ColumnState.Dimmed,
|
||||
});
|
||||
@ -180,14 +184,15 @@ namespace osu.Game.Screens.Play
|
||||
public Column()
|
||||
{
|
||||
Size = new Vector2(WIDTH, HEIGHT);
|
||||
Margin = new MarginPadding { Bottom = 1 }; //todo: probably find a better fix, not quite sure why this works
|
||||
|
||||
for (int r = 0; r<cube_count; r++)
|
||||
for (int r = 0; r < cube_count; r++)
|
||||
{
|
||||
drawableRows.Add(new Box
|
||||
{
|
||||
EdgeSmoothness = new Vector2(padding / 4),
|
||||
Size = new Vector2(cube_size),
|
||||
Position = new Vector2(0, r* WIDTH + padding)
|
||||
Position = new Vector2(0, r * WIDTH),
|
||||
});
|
||||
|
||||
Add(drawableRows[drawableRows.Count - 1]);
|
||||
|
Loading…
Reference in New Issue
Block a user