Clamp `LifetimeStart` of `HitObject`'s to their judgement windows

This commit is contained in:
sw1tchbl4d3 2022-09-27 16:54:24 +02:00
parent 2a5556de33
commit 0cffbb7562
5 changed files with 9 additions and 5 deletions

View File

@ -40,7 +40,7 @@ public DrawableHoldNoteTail(TailNote tailNote)
public void UpdateResult() => base.UpdateResult(true);
protected override double MaximumJudgementOffset => base.MaximumJudgementOffset * release_window_lenience;
public override double MaximumJudgementOffset => base.MaximumJudgementOffset * release_window_lenience;
protected override void CheckForResult(bool userTriggered, double timeOffset)
{

View File

@ -25,7 +25,7 @@ public DrawableSpinnerTick(SpinnerTick spinnerTick)
Origin = Anchor.Centre;
}
protected override double MaximumJudgementOffset => DrawableSpinner.HitObject.Duration;
public override double MaximumJudgementOffset => DrawableSpinner.HitObject.Duration;
/// <summary>
/// Apply a judgement result.

View File

@ -38,7 +38,7 @@ public DrawableDrumRollTick([CanBeNull] DrumRollTick tick)
Filled = HitObject.FirstTick
});
protected override double MaximumJudgementOffset => HitObject.HitWindow;
public override double MaximumJudgementOffset => HitObject.HitWindow;
protected override void CheckForResult(bool userTriggered, double timeOffset)
{

View File

@ -651,7 +651,7 @@ public virtual void OnKilled()
/// <remarks>
/// This does not affect the time offset provided to invocations of <see cref="CheckForResult"/>.
/// </remarks>
protected virtual double MaximumJudgementOffset => HitObject.HitWindows?.WindowFor(HitResult.Miss) ?? 0;
public virtual double MaximumJudgementOffset => HitObject.HitWindows?.WindowFor(HitResult.Miss) ?? 0;
/// <summary>
/// Applies the <see cref="Result"/> of this <see cref="DrawableHitObject"/>, notifying responders such as

View File

@ -3,6 +3,7 @@
#nullable disable
using System;
using System.Collections.Generic;
using System.Diagnostics;
using osu.Framework.Allocation;
@ -214,7 +215,10 @@ private double computeOriginAdjustedLifetimeStart(DrawableHitObject hitObject)
break;
}
return scrollingInfo.Algorithm.GetDisplayStartTime(hitObject.HitObject.StartTime, originAdjustment, timeRange.Value, scrollLength);
double computedStartTime = scrollingInfo.Algorithm.GetDisplayStartTime(hitObject.HitObject.StartTime, originAdjustment, timeRange.Value, scrollLength);
// always load the hitobject before its first judgement offset
return Math.Min(hitObject.HitObject.StartTime - hitObject.MaximumJudgementOffset, computedStartTime);
}
private void updateLayoutRecursive(DrawableHitObject hitObject)