1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Division-by-zero safety + reference our own size

This commit is contained in:
smoogipoo 2018-02-24 02:53:02 +09:00
parent 066abfbdbc
commit 50d1183ec2

View File

@ -113,9 +113,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Size = Body.Size;
OriginPosition = Body.PathOffset;
foreach (var obj in NestedHitObjects)
obj.RelativeAnchorPosition = Vector2.Divide(OriginPosition, Body.DrawSize);
Ball.RelativeAnchorPosition = Vector2.Divide(OriginPosition, Body.DrawSize);
if (DrawSize.X > 0 && DrawSize.Y > 0)
{
var childAnchorPosition = Vector2.Divide(OriginPosition, DrawSize);
foreach (var obj in NestedHitObjects)
obj.RelativeAnchorPosition = childAnchorPosition;
Ball.RelativeAnchorPosition = childAnchorPosition;
}
}
protected override void CheckForJudgements(bool userTriggered, double timeOffset)