From cf81467e1361f17e5c4db842ba1f09c5c6894a95 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 15 Mar 2017 14:00:31 -0300 Subject: [PATCH] Move fade start out of loop --- osu.Game/Screens/Select/Leaderboards/Leaderboard.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 16e811f868..3efd7f4099 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -58,12 +58,13 @@ namespace osu.Game.Screens.Select.Leaderboards { base.Update(); + var fadeStart = scrollContainer.DrawHeight - 10; + fadeStart += scrollContainer.IsScrolledToEnd() ? 70 : 0; + foreach (var s in scrollFlow.Children) { var topY = scrollContainer.ScrollContent.DrawPosition.Y + s.DrawPosition.Y; var bottomY = topY + 70; - var fadeStart = scrollContainer.DrawHeight - 10; - fadeStart += scrollContainer.IsScrolledToEnd() ? 70 : 0; s.ColourInfo = ColourInfo.GradientVertical(Color4.White.Opacity(System.Math.Min((fadeStart - topY) / 70, 1)), Color4.White.Opacity(System.Math.Min((fadeStart - bottomY) / 70, 1)));