1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Also adjust height

This commit is contained in:
Dean Herbert 2021-04-13 16:41:29 +09:00
parent ebf97ff48f
commit 27e851c2ee
2 changed files with 26 additions and 1 deletions

View File

@ -11,7 +11,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations
/// </summary>
public class PointVisualisation : Box
{
public const float MAX_WIDTH = 5;
public const float MAX_WIDTH = 4;
public PointVisualisation(double startTime)
: this()

View File

@ -135,6 +135,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
var line = getNextUsableLine();
line.X = xPos;
line.Width = PointVisualisation.MAX_WIDTH * getWidth(indexInBar, divisor);
line.Height = 0.9f * getHeight(indexInBar, divisor);
line.Colour = colour;
}
@ -193,6 +194,30 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
}
}
private static float getHeight(int indexInBar, int divisor)
{
if (indexInBar == 0)
return 1;
switch (divisor)
{
case 1:
case 2:
return 0.9f;
case 3:
case 4:
return 0.8f;
case 6:
case 8:
return 0.7f;
default:
return 0.6f;
}
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);