Improve IsAlive logic.

This commit is contained in:
Dean Herbert 2016-11-26 17:20:34 +09:00
parent f6bb5a2c49
commit 5764bf8093
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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);