Skip to content

Commit

Permalink
Merge pull request #28802 from peppy/fix-download-progress-bar-visuals
Browse files Browse the repository at this point in the history
Fix beatmap card progress bar becoming pancake when starting
  • Loading branch information
bdach authored Jul 10, 2024
2 parents 1381b3c + 2ba1ebe commit d9e2853
Showing 1 changed file with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public partial class BeatmapCardDownloadProgressBar : CompositeDrawable

public override bool IsPresent => true;

private readonly CircularContainer foreground;

private readonly Box backgroundFill;
private readonly Box foregroundFill;

Expand All @@ -35,22 +33,17 @@ public partial class BeatmapCardDownloadProgressBar : CompositeDrawable

public BeatmapCardDownloadProgressBar()
{
InternalChildren = new Drawable[]
InternalChild = new CircularContainer
{
new CircularContainer
RelativeSizeAxes = Axes.Both,
Masking = true,
Children = new Drawable[]
{
RelativeSizeAxes = Axes.Both,
Masking = true,
Child = backgroundFill = new Box
backgroundFill = new Box
{
RelativeSizeAxes = Axes.Both,
}
},
foreground = new CircularContainer
{
RelativeSizeAxes = Axes.Both,
Masking = true,
Child = foregroundFill = new Box
},
foregroundFill = new Box
{
RelativeSizeAxes = Axes.Both,
}
Expand Down Expand Up @@ -89,7 +82,7 @@ private void stateChanged()

private void progressChanged()
{
foreground.ResizeWidthTo((float)progress.Value, progress.Value > 0 ? BeatmapCard.TRANSITION_DURATION : 0, Easing.OutQuint);
foregroundFill.ResizeWidthTo((float)progress.Value, progress.Value > 0 ? BeatmapCard.TRANSITION_DURATION : 0, Easing.OutQuint);
}
}
}

0 comments on commit d9e2853

Please sign in to comment.