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

Account for path width correctly in LineGraph

This commit is contained in:
David Zhao 2019-03-07 13:45:55 +09:00
parent 00cdb3a44a
commit d97c070ef1

View File

@ -102,9 +102,9 @@ 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
float x = (i + count - values.Length) / (float)(count - 1) * (DrawWidth - path.PathWidth);
float y = GetYPosition(values[i]) * (DrawHeight - path.PathWidth);
path.AddVertex(new Vector2(x, y));
}
}