1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-28 10:17:19 +08:00

Also handle items exiting bounds on the opposite side

This commit is contained in:
Dean Herbert 2021-05-24 13:44:13 +09:00
parent 593fea0d5f
commit 83981b692e

View File

@ -196,12 +196,12 @@ namespace osu.Game.Screens.Play
} }
if (lowestTopScreenSpace.HasValue) if (lowestTopScreenSpace.HasValue)
topRightElements.Y = TopScoringElementsHeight = Math.Max(0, ToLocalSpace(lowestTopScreenSpace.Value).Y); topRightElements.Y = TopScoringElementsHeight = MathHelper.Clamp(ToLocalSpace(lowestTopScreenSpace.Value).Y, 0, DrawHeight - topRightElements.DrawHeight);
else else
topRightElements.Y = 0; topRightElements.Y = 0;
if (highestBottomScreenSpace.HasValue) if (highestBottomScreenSpace.HasValue)
bottomRightElements.Y = BottomScoringElementsHeight = -Math.Max(0, (DrawHeight - ToLocalSpace(highestBottomScreenSpace.Value).Y)); bottomRightElements.Y = BottomScoringElementsHeight = -MathHelper.Clamp(DrawHeight - ToLocalSpace(highestBottomScreenSpace.Value).Y, 0, DrawHeight - bottomRightElements.DrawHeight);
else else
bottomRightElements.Y = 0; bottomRightElements.Y = 0;
} }