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

Merge pull request #23936 from peppy/fix-mania-hold-note-rewind-visuals

Fix osu!mania hold notes sometimes looking incorrect after rewind
This commit is contained in:
Bartłomiej Dach 2023-06-16 20:45:40 +02:00 committed by GitHub
commit b36ded0ba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,19 +242,24 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
bodyPiece.Y = (Direction.Value == ScrollingDirection.Up ? 1 : -1) * Head.Height / 2;
bodyPiece.Height = DrawHeight - Head.Height / 2 + Tail.Height / 2;
if (Time.Current >= HitObject.StartTime)
{
// As the note is being held, adjust the size of the sizing container. This has two effects:
// 1. The contained masking container will mask the body and ticks.
// 2. The head note will move along with the new "head position" in the container.
//
// As per stable, this should not apply for early hits, waiting until the object starts to touch the
// judgement area first.
if (Head.IsHit && releaseTime == null && DrawHeight > 0 && Time.Current >= HitObject.StartTime)
if (Head.IsHit && releaseTime == null && DrawHeight > 0)
{
// How far past the hit target this hold note is.
float yOffset = Direction.Value == ScrollingDirection.Up ? -Y : Y;
sizingContainer.Height = 1 - yOffset / DrawHeight;
}
}
else
sizingContainer.Height = 1;
}
protected override void CheckForResult(bool userTriggered, double timeOffset)
{