1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Do not change depth value of drawables currently contained within a container.

This commit is contained in:
Tom94 2016-11-23 18:30:50 +01:00 committed by Dean Herbert
parent 3e4ff27865
commit 718f2b13a8
4 changed files with 18 additions and 16 deletions

@ -1 +1 @@
Subproject commit 34193c7f15aba3520f73f8ca36c0fbc9cd3951d4
Subproject commit 1a521bb22cfd2c14f58d4cd60fbbfdb70ea8f87b

View File

@ -36,18 +36,18 @@ namespace osu.Game.Screens.Backgrounds
newBackground.Preload(Game, delegate
{
Background oldBackground = background;
float newDepth = 0;
if (background != null)
{
newDepth = background.Depth - 1;
background.Flush();
background.FadeOut(250);
background.Expire();
}
newBackground.Depth = newDepth;
Add(background = newBackground);
background.BlurSigma = blurTarget;
if (oldBackground != null)
{
oldBackground.Depth = 1;
oldBackground.Flush();
oldBackground.FadeOut(250);
oldBackground.Expire();
}
});
});
}

View File

@ -20,12 +20,12 @@ namespace osu.Game.Screens.Select
if (beatmap == null)
return;
float newDepth = 0;
if (beatmapInfoContainer != null)
{
Drawable oldWedgedBeatmapInfo = beatmapInfoContainer;
oldWedgedBeatmapInfo.Depth = 1;
oldWedgedBeatmapInfo.FadeOut(250);
oldWedgedBeatmapInfo.Expire();
newDepth = beatmapInfoContainer.Depth - 1;
beatmapInfoContainer.FadeOut(250);
beatmapInfoContainer.Expire();
}
FadeIn(250);
@ -34,6 +34,7 @@ namespace osu.Game.Screens.Select
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;
Add(beatmapInfoContainer = new BufferedContainer
{
Depth = newDepth,
PixelSnapping = true,
CacheDrawnFrameBuffer = true,
Shear = -Shear,

View File

@ -144,10 +144,11 @@ namespace osu.Game.Screens.Select
if (panel.Hidden)
return;
panel.Depth = index + (panel is BeatmapSetHeader ? panels.Count : 0);
if (!scrollableContent.Contains(panel))
{
panel.Depth = index + (panel is BeatmapSetHeader ? panels.Count : 0);
scrollableContent.Add(panel);
}
}
protected override void Update()