Skip to content

Commit 8e14c24

Browse files
committed
Follow slanted flow logic precedent in test
See `ModSelectOverlay` components.
1 parent 91fb5ed commit 8e14c24

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

osu.Game.Tests/Visual/SongSelect/TestSceneLeaderboardScoreV2.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,16 @@ public void Setup() => Schedule(() =>
6363
RelativeSizeAxes = Axes.X,
6464
AutoSizeAxes = Axes.Y,
6565
Spacing = new Vector2(0f, 2f),
66+
Shear = LeaderboardScoreV2.SHEAR
6667
},
6768
drawWidthText = new OsuSpriteText(),
6869
};
6970

70-
int i = 0;
71-
7271
foreach (var scoreInfo in getTestScores())
7372
{
7473
fillFlow.Add(new LeaderboardScoreV2(scoreInfo, scoreInfo.Position, scoreInfo.User.Id == 2)
7574
{
76-
Margin = new MarginPadding { Right = 10f * i, Left = -10f * i++ },
75+
Shear = Vector2.Zero,
7776
});
7877
}
7978

osu.Game/Screens/SelectV2/Leaderboards/LeaderboardScoreV2.cs

+12-11
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public partial class LeaderboardScoreV2 : OsuClickableContainer, IHasContextMenu
6565
private Colour4 backgroundColour;
6666
private ColourInfo totalScoreBackgroundGradient;
6767

68-
private static readonly Vector2 shear = new Vector2(0.15f, 0);
68+
// TODO: once https://github.com/ppy/osu/pull/28183 is merged, probably use OsuGame.SHEAR
69+
public static readonly Vector2 SHEAR = new Vector2(0.15f, 0);
6970

7071
[Resolved]
7172
private OverlayColourProvider colourProvider { get; set; } = null!;
@@ -112,7 +113,7 @@ public LeaderboardScoreV2(ScoreInfo score, int? rank, bool isPersonalBest = fals
112113
this.rank = rank;
113114
this.isPersonalBest = isPersonalBest;
114115

115-
Shear = shear;
116+
Shear = SHEAR;
116117
RelativeSizeAxes = Axes.X;
117118
Height = height;
118119
}
@@ -245,7 +246,7 @@ private void updateModDisplay()
245246
{
246247
RelativeSizeAxes = Axes.Both,
247248
User = score.User,
248-
Shear = -shear,
249+
Shear = -SHEAR,
249250
Anchor = Anchor.BottomLeft,
250251
Origin = Anchor.BottomLeft,
251252
Colour = ColourInfo.GradientHorizontal(Colour4.White.Opacity(0.5f), Colour4.FromHex(@"222A27").Opacity(1)),
@@ -276,7 +277,7 @@ private void updateModDisplay()
276277
Anchor = Anchor.Centre,
277278
Origin = Anchor.Centre,
278279
Scale = new Vector2(1.1f),
279-
Shear = -shear,
280+
Shear = -SHEAR,
280281
RelativeSizeAxes = Axes.Both,
281282
})
282283
{
@@ -316,7 +317,7 @@ private void updateModDisplay()
316317
{
317318
flagBadgeAndDateContainer = new FillFlowContainer
318319
{
319-
Shear = -shear,
320+
Shear = -SHEAR,
320321
Direction = FillDirection.Horizontal,
321322
Spacing = new Vector2(5),
322323
AutoSizeAxes = Axes.Both,
@@ -340,7 +341,7 @@ private void updateModDisplay()
340341
nameLabel = new TruncatingSpriteText
341342
{
342343
RelativeSizeAxes = Axes.X,
343-
Shear = -shear,
344+
Shear = -SHEAR,
344345
Text = user.Username,
345346
Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold)
346347
}
@@ -356,7 +357,7 @@ private void updateModDisplay()
356357
Name = @"Statistics container",
357358
Padding = new MarginPadding { Right = 40 },
358359
Spacing = new Vector2(25, 0),
359-
Shear = -shear,
360+
Shear = -SHEAR,
360361
Anchor = Anchor.CentreRight,
361362
Origin = Anchor.CentreRight,
362363
AutoSizeAxes = Axes.Both,
@@ -414,7 +415,7 @@ private void updateModDisplay()
414415
},
415416
RankContainer = new Container
416417
{
417-
Shear = -shear,
418+
Shear = -SHEAR,
418419
Anchor = Anchor.CentreRight,
419420
Origin = Anchor.CentreRight,
420421
RelativeSizeAxes = Axes.Y,
@@ -472,15 +473,15 @@ private void updateModDisplay()
472473
Anchor = Anchor.TopRight,
473474
Origin = Anchor.TopRight,
474475
UseFullGlyphHeight = false,
475-
Shear = -shear,
476+
Shear = -SHEAR,
476477
Current = scoreManager.GetBindableTotalScoreString(score),
477478
Font = OsuFont.GetFont(size: 30, weight: FontWeight.Light),
478479
},
479480
modsContainer = new FillFlowContainer
480481
{
481482
Anchor = Anchor.TopRight,
482483
Origin = Anchor.TopRight,
483-
Shear = -shear,
484+
Shear = -SHEAR,
484485
AutoSizeAxes = Axes.Both,
485486
Direction = FillDirection.Horizontal,
486487
Spacing = new Vector2(2f, 0f),
@@ -665,7 +666,7 @@ public RankLabel(int? rank)
665666

666667
Child = new OsuSpriteText
667668
{
668-
Shear = -shear,
669+
Shear = -SHEAR,
669670
Anchor = Anchor.Centre,
670671
Origin = Anchor.Centre,
671672
Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold, italics: true),

0 commit comments

Comments
 (0)