1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Fixed slider bounding box calculation

This commit is contained in:
Henry Lin 2021-07-01 11:20:55 +08:00
parent 7585f1f790
commit c69455cfd0

View File

@ -202,8 +202,16 @@ namespace osu.Game.Rulesets.Osu.Mods
foreach (var pos in pathPositions)
{
// Reduce Width and Height accordingly after increasing X and Y
// to keep the right and bottom edge of the rectangle in place
var right = box.Right;
box.X = Math.Max(box.X, -pos.X);
box.Width = right - box.X;
var bottom = box.Bottom;
box.Y = Math.Max(box.Y, -pos.Y);
box.Height = bottom - box.Y;
box.Width = Math.Min(box.Width, OsuPlayfield.BASE_SIZE.X - pos.X - box.X);
box.Height = Math.Min(box.Height, OsuPlayfield.BASE_SIZE.Y - pos.Y - box.Y);
}