Fix user profile cover showing 1px line when contracted

Addresses https://github.com/ppy/osu/discussions/26068.
This commit is contained in:
Dean Herbert 2023-12-23 21:07:17 +09:00
parent fc56188b95
commit a2e5f62478
No known key found for this signature in database
1 changed files with 8 additions and 0 deletions

View File

@ -232,6 +232,14 @@ private void updateCoverState()
bool expanded = coverToggle.CoverExpanded.Value;
cover.ResizeHeightTo(expanded ? 250 : 0, transition_duration, Easing.OutQuint);
// Without this a very tiny slither of the cover will be visible even with a size of zero.
// Integer masking woes, no doubt.
if (expanded)
cover.FadeIn(transition_duration, Easing.OutQuint);
else
cover.FadeOut(transition_duration, Easing.InQuint);
avatar.ResizeTo(new Vector2(expanded ? 120 : content_height), transition_duration, Easing.OutQuint);
avatar.TransformTo(nameof(avatar.CornerRadius), expanded ? 40f : 20f, transition_duration, Easing.OutQuint);
flow.TransformTo(nameof(flow.Spacing), new Vector2(expanded ? 20f : 10f), transition_duration, Easing.OutQuint);