Fix autosize weirdness by specifying a constant size for the x axis

This commit is contained in:
Dean Herbert 2022-03-04 13:48:42 +09:00
parent 010fa7ed01
commit c063a73742

View File

@ -121,6 +121,8 @@ namespace osu.Game.Screens.Ranking.Statistics
Container axisFlow; Container axisFlow;
const float axis_font_size = 12;
InternalChild = new GridContainer InternalChild = new GridContainer
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -142,7 +144,7 @@ namespace osu.Game.Screens.Ranking.Statistics
axisFlow = new Container axisFlow = new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y Height = axis_font_size,
} }
}, },
}, },
@ -162,7 +164,7 @@ namespace osu.Game.Screens.Ranking.Statistics
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Text = "0", Text = "0",
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold) Font = OsuFont.GetFont(size: axis_font_size, weight: FontWeight.SemiBold)
}); });
for (int i = 1; i <= axis_points; i++) for (int i = 1; i <= axis_points; i++)
@ -179,7 +181,7 @@ namespace osu.Game.Screens.Ranking.Statistics
X = -position / 2, X = -position / 2,
Alpha = alpha, Alpha = alpha,
Text = axisValue.ToString("-0"), Text = axisValue.ToString("-0"),
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold) Font = OsuFont.GetFont(size: axis_font_size, weight: FontWeight.SemiBold)
}); });
axisFlow.Add(new OsuSpriteText axisFlow.Add(new OsuSpriteText
@ -190,7 +192,7 @@ namespace osu.Game.Screens.Ranking.Statistics
X = position / 2, X = position / 2,
Alpha = alpha, Alpha = alpha,
Text = axisValue.ToString("+0"), Text = axisValue.ToString("+0"),
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold) Font = OsuFont.GetFont(size: axis_font_size, weight: FontWeight.SemiBold)
}); });
} }
} }