mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:57:36 +08:00
Merge branch 'line-graph-fix'
This commit is contained in:
commit
7fa84335ce
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
path = new SmoothPath
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
PathWidth = 1
|
||||
PathRadius = 1
|
||||
},
|
||||
marker = new CircularContainer
|
||||
{
|
||||
|
@ -21,8 +21,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
||||
|
||||
public float PathWidth
|
||||
{
|
||||
get => path.PathWidth;
|
||||
set => path.PathWidth = value;
|
||||
get => path.PathRadius;
|
||||
set => path.PathRadius = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
Masking = true,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = path = new SmoothPath { RelativeSizeAxes = Axes.Both, PathWidth = 1 }
|
||||
Child = path = new SmoothPath { RelativeSizeAxes = Axes.Both, PathRadius = 1 }
|
||||
});
|
||||
}
|
||||
|
||||
@ -102,9 +102,10 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
for (int i = 0; i < values.Length; i++)
|
||||
{
|
||||
float x = (i + count - values.Length) / (float)(count - 1) * DrawWidth - 1;
|
||||
float y = GetYPosition(values[i]) * DrawHeight - 1;
|
||||
// the -1 is for inner offset in path (actually -PathWidth)
|
||||
// Make sure that we are accounting for path width when calculating vertex positions
|
||||
// We need to apply 2x the path radius to account for it because the full diameter of the line accounts into height
|
||||
float x = (i + count - values.Length) / (float)(count - 1) * (DrawWidth - 2 * path.PathRadius);
|
||||
float y = GetYPosition(values[i]) * (DrawHeight - 2 * path.PathRadius);
|
||||
path.AddVertex(new Vector2(x, y));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user