mirror of
https://github.com/ppy/osu
synced 2024-12-15 03:16:17 +00:00
Improve IsAlive logic.
This commit is contained in:
parent
f6bb5a2c49
commit
5764bf8093
@ -17,9 +17,9 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
|
||||
public override bool RemoveWhenNotAlive => false;
|
||||
|
||||
public bool OnScreen;
|
||||
public bool IsOnScreen;
|
||||
|
||||
public override bool IsAlive => OnScreen;
|
||||
public override bool IsAlive => IsOnScreen && base.IsAlive;
|
||||
|
||||
private Container nestedContainer;
|
||||
|
||||
|
@ -199,7 +199,7 @@ namespace osu.Game.Screens.Select
|
||||
Lifetime.AliveItems.ForEach(delegate (Panel p)
|
||||
{
|
||||
float panelPosY = p.Position.Y;
|
||||
p.OnScreen = panelPosY >= Current - p.DrawHeight && panelPosY <= Current + drawHeight;
|
||||
p.IsOnScreen = panelPosY >= Current - p.DrawHeight && panelPosY <= Current + drawHeight;
|
||||
});
|
||||
|
||||
int firstIndex = yPositions.BinarySearch(Current - Panel.MAX_HEIGHT);
|
||||
@ -216,7 +216,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
var panel = Lifetime[i];
|
||||
|
||||
panel.OnScreen = true;
|
||||
panel.IsOnScreen = true;
|
||||
|
||||
float panelDrawY = panel.Position.Y - Current + panel.DrawHeight / 2;
|
||||
float dist = Math.Abs(1f - panelDrawY / halfHeight);
|
||||
|
Loading…
Reference in New Issue
Block a user