1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 08:07:24 +08:00

Fix bottom square being clipped

This commit is contained in:
DrabWeb 2017-03-23 08:13:03 -03:00
parent 938f5eaf58
commit bbca6cf602
3 changed files with 21 additions and 17 deletions

View File

@ -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();

View File

@ -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);
}
}
},
},
};
}

View File

@ -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]);