1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 07:43:00 +08:00

Fix noticeable masking artifact of beatmap cards when already downloaded

Had a similar fix before seeing https://github.com/ppy/osu/pull/20743#discussion_r994955470, but using that diff instead so co-authoring.

Co-Authored-By: Bartłomiej Dach <dach.bartlomiej@gmail.com>
This commit is contained in:
Joseph Madamba 2024-03-08 13:13:08 -08:00
parent a47ccb8edd
commit b309aad895

View File

@ -77,7 +77,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards
downloadTracker,
background = new Container
{
RelativeSizeAxes = Axes.Both,
RelativeSizeAxes = Axes.Y,
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Child = new Box
@ -165,9 +165,11 @@ namespace osu.Game.Beatmaps.Drawables.Cards
private void updateState()
{
float targetWidth = Width - (ShowDetails.Value ? ButtonsExpandedWidth : ButtonsCollapsedWidth);
float buttonAreaWidth = ShowDetails.Value ? ButtonsExpandedWidth : ButtonsCollapsedWidth;
float mainAreaWidth = Width - buttonAreaWidth;
mainArea.ResizeWidthTo(targetWidth, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
mainArea.ResizeWidthTo(mainAreaWidth, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
background.ResizeWidthTo(buttonAreaWidth + BeatmapCard.CORNER_RADIUS, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
background.FadeColour(downloadTracker.State.Value == DownloadState.LocallyAvailable ? colours.Lime0 : colourProvider.Background3, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);
buttons.FadeTo(ShowDetails.Value ? 1 : 0, BeatmapCard.TRANSITION_DURATION, Easing.OutQuint);